[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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
Re: Change the value of global variables/params ??


<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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.