设置变量值后,无法更改或修改该值!
http://www.w3schools.com/xsl/el_variable.asp
假设你有这个:
<xsl:variable name="var">1</xsl:variable>
然后,在您需要的任何地方,您可以使用以下部分(在XSLT 1.0中工作),activated如果$var等于1(或其他值),它将在您的输出中放置值$var.
<xsl:choose>
    <xsl:when test="$var=1">activated</xsl:when>
    <xsl:otherwise><xsl:value-of select="$var"/></xsl:otherwise>
</xsl:choose>
或者您可以声明新变量:
<xsl:variable name="var2">
    <xsl:choose>
        <xsl:when test="$var=1">activated</xsl:when>
        <xsl:otherwise><xsl:value-of select="$var"/></xsl:otherwise>
    </xsl:choose>
</xsl:variable>
在这种情况下,您将必须使用指令在输出中打印它:
<xsl:value-of select="$var2" />