[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: Global variables and changing within templates


Subject: Re: Global variables and changing within templates
From: Steve Tinney <stinney@xxxxxxxxxxxxx>
Date: Wed, 09 Feb 2000 23:23:26 -0500

> 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



Current Thread
Keywords
xsl