Re: 11.5 Variables and parameters within templates

bob_buxton@uk.ibm.com wrote:
> 
> I have been somewhat confused by the wording of the phrase  "xsl:variable is
> allowed
> anywhere within a template that an instruction is allowed. In this case,
> the binding is visible for all following siblings and their descendants."
> 
> I took it mean that "siblings and their descendants."  referred to the structure
> of the source document and that if I set a variable whilst processing a template
> for an element  that I would be able to use that variable in the templates for
> child elements.
> 
> Scott Boag informs me that:
> >> The visibility/scoping is based on the stylesheet structure.  A variable set
> in one template is not visible in another template, unless you pass it as a
> parameter.  Note that I think "siblings" in "xsl:variable is allowed anywhere
> within a template that an instruction is allowed. In this case, the binding is
> visible for all following siblings and their descendants. "  means sibling of
> the xsl:variable element, not the containing element.

Scott's correct.  Section 11 says:

"For any use of these variable-binding elements, there is a region
of the ***stylesheet*** tree within which the binding is visible"

James

Received on Saturday, 11 December 1999 00:17:45 UTC