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 24508 - xsl:fork streamability rule #2
Summary: xsl:fork streamability rule #2
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Last Call drafts
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: 2014-02-05 03:48 UTC by Abel Braaksma
Modified: 2014-08-02 13:26 UTC (History)
1 user (show)

See Also:


Attachments

Description Abel Braaksma 2014-02-05 03:48:39 UTC
The second rule of 19.8.4.19 Streamability of xsl:fork (http://www.w3.org/TR/xslt-30/#streamability-xsl-fork) is ambiguous in the part "not grounded and motionless". Does it mean "not grounded and also not motionless", or does it mean "not the both of grounded and motionless".

At any rate, I think that part can be removed, because even when grounded and/or motionless, the rule is still applicable: the result of xsl:fork with one xsl:sequence is the result of the streamability analysis of xsl:sequence.
Comment 1 C. M. Sperberg-McQueen 2014-02-11 15:25:20 UTC
We discussed this in Prague.

For "that is not grounded and motionless" read "that is not both grounded and motionless" (or some equivalent).

We considered dropping the qualification entirely before realizing that we mustn't.

The "that" is restrictive; not all readers saw this at once, so if there is a way to make it clearer, it might be helpful.
Comment 2 Michael Kay 2014-02-17 08:10:11 UTC
I have fixed this by reordering the rules. Since rule 4 requires that all the xsl:sequence instructions are grounded, we can move this rule earlier and simplify the subsequent rules.

I also noted (and fixed) that the current rules say that if all the xsl:sequence instructions are motionless, the result is consuming. This is clearly wrong.
Comment 3 Abel Braaksma 2014-03-04 11:12:28 UTC
The bottom line of streamaiblity of xsl:fork is that xsl:sequences must be grounded, and then the widest sweep counts. Hence, I suggest to simplify this even further, as follows:

1. If the posture of any of the child xsl:sequence instructions is not grounded, then roaming and free-ranging.

2. Otherwise, the posture is grounded and the sweep is the widest sweep of any of the xsl:sequence children (or motionless if there are no children).

This then gets more in line with the xsl:map streamability rules, (which is only slightly different because xsl:map-entry has different rules than xsl:sequence).

----
If we decide to stick to the current rules, note:
The current rule #4 has a typo: "then the grounded..." => "then grounded...".

----
As a result of the new rules, the last paragraph has become redundant. The rule about "exactly one child", for which I filed this bug, is now gone, which I think is the right thing to do: why allow an exceptional case for which xsl:fork is pointless anyway?

The last para, should probably go:

"The only case where xsl:fork is permitted to return streamed nodes is in the case where only one of the xsl:sequence instructions is consuming (in which case the xsl:fork instruction is pointless)." 

(I took the liberty to reopen the bug report, it was closed)
Comment 4 Michael Kay 2014-05-15 14:57:26 UTC
The suggestions in comment #3 are essentially editorial; they simplify the rules while leading to the same outcome. I have therefore accepted and applied the changes suggested.