My understanding is that <xsl:variable>
is immutable and cannot be reassigned.
I am new to XSL and came across a situation like what is in the example below.
<xsl:stylesheet>
<xsl:variable name="temp" select="true()"/>
<xsl:template name="example">
<xsl:variable name="temp" select="false()"/>
<p><xsl:value-of select="$temp"/></p>
</xsl:template>
</styleheet>
I have not found anything definitive as to why this occurs. The only way I can reason that I'm not getting an error and why temp
will output false
is that there is a global temp
variable AND an a local temp
variable (and somehow are not colliding).
Why am I able to "reassign" temp
?