This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Variables...
> I have got a global variable in XSL (declared at the begginning), how do I
> set it's value later on in the stylesheet. If I use
You don't. You can't. Unless you use an XSL processor with an evil
extension like saxon:assign.
> <xsl:variable...></xsl:variable> then doesn't that just create a new local
> variable, instead of using the global one?
Yes, exactly. A local variable may shadow a global one in XSL, but it
may not shadow another local one within the same template.
My experience is that if one is trying to solve a problem with
assignment, one is probably not thinking at the problem in the XSL way.
I am not 100% convinced, though, that there are no problems out there
which really do need (at least in practical terms) assignment.
Perhaps if you illustrate the problem you're trying to solve someone can
suggest a more XSL-ish approach?
Steve
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list