Re: xsl:use-when and shadow attributes on LREs, extension instructions and data elements

> On 11 Oct 2015, at 12:27, Abel Braaksma <abel.braaksma@xs4all.nl> wrote:
> 
> We say about using xsl:use-when on elements not in the XSLT namespace the following:
> 
> "A literal result element, or any other element within a stylesheet module that is not in the XSLT namespace, may similarly carry an xsl:use-when attribute."
> 
> We use the words "similarly" and "carry". But we don't seem to explicitly say that the same rules apply, i.e., that if the EBV is false(), the LRE is effectively excluded, including all its children. In the case of data elements and extension instructions I would argue that its behavior on that instruction is implementation defined. Or if not, I think we should explicitly say so. 

I suggest we move the sentence, so that the the first paragraph reads:

Any element in the XSLT namespace may have a use-when attribute whose value is an XPath expression that can be evaluated statically. A literal result element, or any other element within a stylesheet module that is not in the XSLT namespace, may similarly carry an xsl:use-when attribute. If the attribute is present and the effective boolean valueXP30 of the expression is false, then the element, together with all the nodes having that element as an ancestor, is effectively excluded from the stylesheet module. When a node is effectively excluded from a stylesheet module the stylesheet module has the same effect as if the node were not there. Among other things this means that no static or dynamic errors will be reported in respect of the element and its contents, other than errors in the use-when attribute itself.


> 
> Somewhat on the same token, we don't mention how shadow attributes (3.14.2) are treated on extension instructions and/or data elements. We seem to be inclusive (we only mention "where the attribute name is in no namespace and the name of the parent element is in the XSLT namespace"), but then we go on and end the paragraph being exclusive listing where it does not apply. That list does not include extension instructions or data elements, for which I could argue it is implementation dependent.

The section on shadow attributes starts:

Wherever a no-namespace attribute is defined for an element in the XSLT namespace, instead of supplying the attribute value explicitly in the stylesheet, a shadow attribute may be supplied allowing the value of the attribute to be statically computed during the preprocessing phase. 

Therefore:

* attributes whose names begin “_” on LREs are treated as ordinary attributes
* attributes whose names begin “_” on data elements and extension instructions are treated like any other attribute, that is, their effect is implementation-defined.

Michael Kay
Saxonica

> 
> Not reported in Bugzilla as I'm not sure this is a bug.
> 
> Cheers,
> Abel
> 
> 

Received on Thursday, 15 October 2015 15:52:06 UTC