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


Khalid wrote:
> Hello Gentlmen,
> What I am trying to is this.
> At the very top level of my xsl doc I a declare an empty variable with no values
> like this
> 
> <xsl:variable name ="monday"/>
> 
> now in my temlates at run time I want to assign this variable a value of 
> 
> <xsl:variable name = "$monday" select = "'Monday'"/>
> 
> which I want to compare with some other string at run time?
> Now first of all is it possible to do?If it is then is my syntactic approach
> is valid,and if it is then how come I don't see the value I set for monday :-)

It's not possible to change the value of a variable once declared.
So you'll need some other means of accomplishing this. Perhaps
you can use xsl:call-template from template A to call template B
then template C (from B) etc. or similar to pass the variables from
template to template.

Morten



 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]