Re: [xsl] How to assign a value and reuse a global variable

Subject: Re: [xsl] How to assign a value and reuse a global variable
From: Bertrand Delacretaz <bdelacretaz@xxxxxxxxxxxxxx>
Date: Wed, 13 Feb 2002 07:34:22 +0100
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