This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The spec, under 9.7 Static Expressions says: <quote> If two static variables satisfying this rule have the same name and are both in scope, the one that appears most recently in stylesheet tree order; as a consequence of rules defined elsewhere this will always be consistent with the declaration having highest import precedence. </quote> I think the first sentence is meant to mean something like: "If two static [...], then the static variable that appears most recently in stylesheet tree order is in scope." (I am missing a verb and a (prepositional) object in the sentence, I think). I'm not 100% sure, but I think it means (among others) that the following is legal: <xsl:variable static="yes" name="first" select="'hello'" /> <xsl:variable static="yes" name="first" select="$first || ' world'" /> Because the one most recently declared in tree-order is valid, and the variable is not in scope of itself, so $first in the expression refers to the previous declaration, and is legal. The variable would now hold string "hello world".
> I'm not 100% sure, but I think it means (among others) that the following > is legal: > <xsl:variable static="yes" name="first" select="'hello'" /> > <xsl:variable static="yes" name="first" select="$first || ' world'" /> Correcting myself, rules just prior to this section ensure that both variables must be consistent (i.e. have the same value), which clearly is not the case here. It should throw XTSE3450 (meaning the values are inconsistent). If the second variable would occur in an imported stylesheet and be imported after the first declaration, overriding the value is allowed, but you would not be able to access the value of the original variable. Leaving the bug open because of the typo in the quote in the comment#0 above.
I've (silently) fixed the typo, the sentence now reads: If two static variables satisfying this rule have the same name and are both in scope, the one that appears most recently in stylesheet tree order is used.