This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]