This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Global variables and changing within templates
- To: xsl-list at mulberrytech dot com
- Subject: Re: Global variables and changing within templates
- From: Steve Tinney <stinney at sas dot upenn dot edu>
- Date: Wed, 09 Feb 2000 23:23:26 -0500
- References: <14498.5954.751000.807495@menteith.com>
- Reply-To: xsl-list at mulberrytech dot com
> 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