w3c / qtspecs

XSLT and XQuery Specifications - the source used to build the specs, and the errata
Other
30 stars 25 forks source link

[xslt30] xsl:expose is not classified as a declaration #20

Open michaelhkay opened 3 years ago

michaelhkay commented 3 years ago

The xsl:expose element is not classified as a "declaration", either in the element syntax summary, or in the list of declarations appearing in section 3.7 of the spec.

(As a result of this omission, Saxon 10 handles xsl:expose incorrectly when the stylesheet uses forwards compatible mode).

michaelhkay commented 3 years ago

The content model of xsl:package is given as

<!-- Content: ((xsl:expose | declarations)*) -->

Suggesting that it's a deliberate decision not to classify xsl:expose as a declaration. Presumably the reason is that it can only appear as a child of xsl:package, not of xsl:transform/stylesheet.

It's not actually clear whether classifying an element as a declaration has any normative effect. Section 3.10 contains the text

If the element is in the XSLT namespace and appears as a child of the xsl:stylesheet element, and XSLT 3.0 does not allow the element to appear as a child of the xsl:stylesheet element, then the element and its content must be ignored.

which probably ought to say something about children of xsl:package, but it's not exactly wrong as written.