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

Re: passing arguments in the xml-stylesheet line

Subject: Re: passing arguments in the xml-stylesheet line
From: David_Benua@xxxxxxxxxxxxxx
Date: Fri, 7 Dec 2001 06:14:17 -0500
passing arguments to xsl
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


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.