The only way to set the value of a xsl:variable is to do it at the initialization, in the body of it.
<xsl:variable name="myvar">
<xsl:choose>
<xsl:when test="condition'">
<xsl:value-of select="$value"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$other_value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="condition'">
<xsl:value-of select="$value"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$other_value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
So if you start your initialization like this
<xsl:variable name="myvar4" select="lower-case($name)"/>
you cannot change its level anmore (globally).
Keine Kommentare:
Kommentar veröffentlichen