W3C home > Mailing lists > Public > xsl-editors@w3.org > October to December 1999

Re: 11.5 Variables and parameters within templates

From: James Clark <jjc@jclark.com>
Date: Sat, 11 Dec 1999 10:34:50 +0700
Message-ID: <3851C65A.55D548D9@jclark.com>
To: bob_buxton@uk.ibm.com
CC: xsl-editors@w3.org, Scott_Boag/CAM/Lotus@lotus.com
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:49 GMT