Could xsl:variable be defined twice with same name in same scope.
For code similar to the following:
<xsl:template match="\">
<table>
<tr><td>
<xsl:variable name="status" select="normal"/>
</td></tr>
<tr><td>
<xsl:variable name="status" select="failed"/>
</td></tr>
</table>
</xsl:template>
Maybe it depends on browse’s type. What is the standard?
First, two variables never have the same scope. Even if they are both global, the scope of the variable excludes its own select expression, so the scope of the two variables is different.
Second, in your example the scope of the two variables isn’t even overlapping. Each variable is confined to its own containing
tdelement.For two global variables, the rule is that you can have two variables with the same name provided they have different import precedence, in which case all references are treated as references to the one with higher precedence.
If one variable is local and the other is global, then the local variable wins if it is in scope.
If you have two local variables with overlapping scope, this is an error in XSLT 1.0, but is permitted in XSLT 2.0; within the overlap area, the variable with smaller scope wins.