[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Top-level Variables and Parameters (XSLT 1.0 spec,

Subject: RE: Top-level Variables and Parameters (XSLT 1.0 spec, section 11.4)
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 19 Aug 2009 15:26:46 +0100
RE:  Top-level Variables and Parameters (XSLT 1.0 spec
> The XSLT 1.0 spec says in 11.4:
> 
>    Both xsl:variable and xsl:param are allowed as top-level elements.
>    A top-level variable-binding element declares a global variable
>    that is visible everywhere. A top-level xsl:param element declares
>    a parameter to the stylesheet; XSLT does not define the mechanism
>    by which parameters are passed to the stylesheet. It is an error
>    if a stylesheet contains more than one binding of a top-level
>    variable with the same name and same import precedence.
> 
>    http://www.w3.org/TR/xslt#variables
> 
> Does the statement defining an error condition apply to both 
> xsl:variable and xsl:param or only to xsl:variable?

It's intended to apply to both. I agree it could be clearer.

The rule in 2.0 is:

[ERR XTSE0630] It is a static error if a stylesheet contains more than one
binding of a global variable with the same name and same import precedence,
unless it also contains another binding with the same name and higher import
precedence.

which relates to the definitions earlier:

[Definition: A top-level variable-binding element declares a *global
variable* that is visible everywhere (except where it is shadowed by another
binding).]

[Definition: The two elements xsl:variable and xsl:param are referred to as
*variable-binding elements* ].

The significant difference from 1.0 is that in 2.0 it's not an error to have
two bindings with the same precedence if there is another one with higher
precedence than either: XSLT 1.0 defined the rule differently for different
kinds of declaration, and 2.0 made it consistent.
> 
> I'm asking in order to know whether to file bugs against 
> LibXSLT and Xalan-J with regard to this error condition.
> 
> --
> Michael Ludwig

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.