Subject: Re: [xsl] passing arguments in the xml-stylesheet line From: David_Benua@xxxxxxxxxxxxxx Date: Fri, 7 Dec 2001 06:14:17 -0500 |
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: [xsl] 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] passing arguments in the , Garrick Besterwitch | Thread | [xsl] ANN: New editions of two book, G. Ken Holman |
RE: [xsl] Multiple documents output, Sabrina Fords | Date | Re: [xsl] Multiple documents output, ronald heller |
Month |