RE: variable question

Subject: RE: variable question
From: Mike Brown <mbrown@xxxxxxxxxxxxx>
Date: Thu, 30 Dec 1999 16:21:47 -0700
> > As you have discovered, a variable assignment only has
> > scope along the descendant and following-sibling axes.

I guess that's not exactly what I wanted to say. Relative to the variable
binding element, the variable is in scope for the following-sibling axis,
and for the descendant axis relative to each of those following-siblings.
 
> Based on that, why didn't setting the variable in the
> root template make it in scope for all the child templates?

Because templates invoked via call-templates or apply-templates are not
children of the template in which the invocation takes place. All
xsl:template elements are siblings of each other. This relationship has
nothing to do with the order in which the templates are acted upon.

In other words, for a given node in the stylesheet tree, you can determine,
by looking "up" the tree, what variables are in scope without having to know
how you arrived at that particular node.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread