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 24532 - Streamability of NodeComp, before/after operator
Summary: Streamability of NodeComp, before/after operator
Status: CLOSED WORKSFORME
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 21:22 UTC by Abel Braaksma
Modified: 2014-02-24 15:01 UTC (History)
1 user (show)

See Also:


Attachments

Description Abel Braaksma 2014-02-05 21:22:41 UTC
This is somewhat similar as the previous bug 24531. The same that was written there might apply here. In addition:

How can a processor possibly check using forward-only streaming whether one node is before the other? There is only two situations using streaming nodes on both operands, that is currently streamable and that is when one of the operands is motionless and the other is consuming, or when both are motionless.

a) foo >> bar
b) foo[@bar << @zzz]
c) @foo << bar
d) foo << .
e) ancestor-or-self::foo >> bar

Hmm, while writing this down, I am finding out the obvious logic here: one of the nodes will always be in the current stack, which is always before any consuming expression. And if both are motionless, their relative position is known.

Is this true always? Is there an easy proof for this? Common sense tells me this is correct, but still, I find operators << and >> to "feel" very free-ranging.
Comment 1 Michael Kay 2014-02-06 10:41:50 UTC
I believe that document order on two nodes within a streamed document is perfectly well defined, and indeed it is fundamental to streaming that it should be well defined. We have however severely restricted the ability to process two nodes in a streamed document simultaneously, and therefore to ask questions about the relative order of two such nodes, because it's in the nature of streaming that we only process one node at a time.

The expression (A << B) is disallowed (free-ranging) if A and B are both consuming or if either is free-ranging. But I think this leaves expressions like (.. << .) well defined and streamable. Indeed I think that (. << child::author) is probably permitted (and is consuming), provided there is only one author; though it's a pretty useless thing to write.
Comment 2 C. M. Sperberg-McQueen 2014-02-12 09:48:16 UTC
The WG discussed this during the ftf meeting in Prague and decided that this issue is (as noted) essentially similar to bug 24531; we close it the same way.