I donβt think you can use XSL variables to concatenate, because once the value of a variable is set, it cannot be changed . Instead, I think you want something like:
<xsl:for-each select="catalog/cd"> <xsl:choose> <xsl:when test="position() = 1"> <xsl:value-of select="country"/> </xsl:when> <xsl:otherwise> ;<xsl:value-of select="country"/> </xsl:otherwise> </xsl:choose> </xsl:for-each>
Does that make sense to you?
Edit: I just realized, I might have misunderstood how you are going to use this variable. The above snippet can be wrapped in a variable element for later use, if you meant it:
<xsl:variable name="VariableName"> <xsl:for-each select="catalog/cd"> <xsl:choose> <xsl:when test="position() = 1"> <xsl:value-of select="country"/> </xsl:when> <xsl:otherwise> ;<xsl:value-of select="country"/> </xsl:otherwise> </xsl:choose> </xsl:for-each> </xsl:variable>
Errika e
source share