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

Re: How to assign a value and reuse a global variable

Subject: Re: How to assign a value and reuse a global variable
From: Bertrand Delacretaz <bdelacretaz@xxxxxxxxxxxxxx>
Date: Wed, 13 Feb 2002 07:34:22 +0100
xslt variable reuse
On Monday 11 February 2002 18:51, Khalid wrote:
>. . .
> now in my temlates at run time I want to assign this variable a value
> <xsl:variable name = "$monday" select = "'Monday'"/>
>. . .

Your problem is that XSLT variables are not modifiable - coming from a 
java/C++ background we'd have called them constants instead.

There is an excellent discussion of this ("programming without 
assignement statements") in Mike Kay's book "XSLT programmer's 
reference".

In your case, you might want to use <xsl:with-param> instead to call a 
template with "Monday" as the parameter value.

-- 
 -- Bertrand Delacrétaz, www.codeconsult.ch
 -- web technologies consultant - OO, Java, XML, C++






 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.