This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29432 - [XSLT30] unclear what instructions are allowed in tail-position after xsl:on-empty
Summary: [XSLT30] unclear what instructions are allowed in tail-position after xsl:on-...
Status: CLOSED WORKSFORME
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-08 06:23 UTC by Abel Braaksma
Modified: 2016-02-18 20:43 UTC (History)
0 users

See Also:


Attachments

Description Abel Braaksma 2016-02-08 06:23:49 UTC
The instruction xsl:on-empty (section 8.4.2) must be in tail-position. Most of the time this is pretty clear and we write about this:

<quote>
It must not be followed in the sequence constructor by any other instruction, other than xsl:fallback, or by a significant text node (that is, a text node that has not been discarded under the provisions of 4.3 Stripping Whitespace from the Stylesheet), or by a literal result element. It may, however, be followed by non-instructions such as xsl:catch where appropriate.
</quote>

Any instruction possibly creating something inside the sequence constructor is clearly disallowed.

But what about instructions that do not create content? What about xsl:result-document, xsl:message, xsl:assert? These are not so much "non-instructions" (an odd term, btw), but they also do not add to the sequence constructor.

Since this was introduced to aid streaming, and since either of the instructions mentioned above are potentially consuming, I propose to disallow them, or to add an extra rule something like:

"Any following sibling instruction that does not create content *must* have grounded posture and motionless sweep when streaming."
Comment 1 Michael Kay 2016-02-08 10:30:08 UTC
I think the spec is unambiguous because the term "instruction" is precisely defined.

ยง2.4: [Definition: An instruction is either an XSLT instruction or an extension instruction.]

[Definition: An XSLT instruction is an XSLT element whose syntax summary in this specification contains the annotation <!-- category: instruction -->.]

This clearly includes xsl:result-document, xsl:message, and xsl:assert. We could have permitted these to appear after xsl:on-empty, but whether by accident or by design, we don't.
Comment 2 Abel Braaksma 2016-02-08 17:25:49 UTC
(In reply to Michael Kay from comment #1)
> We could have permitted these to appear after xsl:on-empty, but whether by
> accident or by design, we don't.
Yes, you are right, I took the text too liberal. I think we can close this one, if you think it warrants WG discussion please reopen.