[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: Change the value of global variables/params ??


Subject: Re: Change the value of global variables/params ??
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 7 Dec 1999 22:22:13 GMT



<xsl:template name="sub">
    <xsl:variable name="foo" select="'abc'"/>
    <xsl:value-of select="$foo"/>
    <xsl:variable name="foo" select="'def'"/>
    <xsl:value-of select="$foo"/>
</xsl:template>

Calling this template will output  --   abcdef


that was legal xsl until one of the later drafts, October perhaps
can't remember exactly when they decided to ban such `shadowing'.
There is no way you can ever need such a feature as it is always
possible to change the second variable name to foo2. You are
not really changing the value f foo, just declaring a new variable with
the same name that `hides' the first. As it is always possible to tell
just from the position in the template, which variable is being
referenced by $foo no functionality is lost by insisting that the second
variable has a different name.

David


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords
xsl