I reviewed the "11.5 Variables and Parameters within Templates" in XSLT spec, seems like the MS IE 6's implementation follows the spec:
The following is from the spec:
A binding shadows another binding if the binding occurs at a point where the other binding is visible, and the bindings have the same name. It is an error if a binding established by an xsl:variable or xsl
aram element within a template shadows another binding established by an xsl:variable or xsl
aram element also within the template. It is not an error if a binding established by an xsl:variable or xsl
aram element in a template shadows another binding established by an xsl:variable or xsl
aram top-level element. Thus, the following is an error:
<xsl:template name="foo">
<xsl
aram name="x" select="1"/>
<xsl:variable name="x" select="2"/>
</xsl:template>
However, the following is allowed:
<xsl
aram name="x" select="1"/>
<xsl:template name="foo">
<xsl:variable name="x" select="2"/>
</xsl:template>
NOTE: The nearest equivalent in
Java to an xsl:variable element in a template is a final local variable declaration with an initializer. For example,
<xsl:variable name="x" select="'value'"/>
has similar semantics to
final Object x = "value";