This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: How to assign a value and reuse a global variable
- From: Bertrand Delacretaz <bdelacretaz at codeconsult dot ch>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Wed, 13 Feb 2002 07:34:22 +0100
- Subject: Re: [xsl] How to assign a value and reuse a global variable
- Organization: codeconsult
- References: <3c6804be.49fb.0@telusplanet.net>
- Reply-to: xsl-list at lists dot mulberrytech dot com
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