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]

Re: Global variables and changing within templates


> If I define a global variable, how can I pass it to a template, change
> it within the template, and be able to access the new value for the
> variable after the template processing is complete ?

There are two answers here.  (1) You can't.  You need to learn how to
use recursion to achieve the desired effects.  (2) You can if you use an
extension mechanism like saxon:assign; that depends on your XSL
processor.

I'm not going to engage in gross generalizations about the necessity of
saxon:assign and the like, but I have yet to encounter a problem that I
couldn't solve without it, including writing an XSL word-counting
script.

To turn one's back on problem-solving with modifiable variables, and to
know recursion, is to know XSL.

 Steve


 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]