[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: passing arguments in the xml-stylesheet line
Garrick, This is another one of those XSL beginner FAQs... The short answer is that you cannot change the value of a <xsl:variable> once you create it. Perhaps the XSLT designers should not have called it a "variable" since it's value doesn't really "vary". But it's much too late for that debate now. Depending on your exact circumstances, you can sometime "over-ride" a variable: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform"> <xsl:variable name="foo" select="'bar'" /> <xsl:template match="/"> <root> <xsl:value-of select="$foo" /> <inner> <xsl:variable name="foo" select="'baz'" /> <xsl:value-of select="$foo" /> </inner> </root> </xsl:template> </xsl:stylesheet> Inside the <inner> node, the value of $foo becomes 'baz', while anywhere else in the stylesheet, it remains 'bar'. I hope that this helps Dave Date: Fri, 7 Dec 2001 11:56:42 +0530 From: "Garrick Besterwitch" <garrickb@xxxxxxxxxxx> Subject: Re: passing arguments in the xml-stylesheet line Hi , I have a globle variable defined at the top of my xsl file.... How do I change the value of this variable based on some condition inside a template????. Thanks Garrick XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|