xsl-list
[Top] [All Lists]

RE: [xsl] Top-level Variables and Parameters (XSLT 1.0 spec, section 11.4)

2009-08-19 10:27:25
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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>