Project

Profile

Help

Bug #5529

open

Streaming: effect of "/" versus "!"

Added by Michael Kay about 1 month ago. Updated about 1 month ago.

Status:
New
Priority:
Low
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2022-05-20
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

Test case sx-intersect-313

This may be a problem in the spec rather than in the Saxon implementation.

The expression (A intersect B) / (.+1) is streamable, while (A intersect B) ! (.+1) is not. This seems unreasonable, since they are obviously equivalent.

Actions #1

Updated by Michael Kay about 1 month ago

Similarly, (test case sx-intersect-315)

<xsl:for-each select="A intersect B">
  <xsl:value-of select=".+1"/>
</xsl:for-each>

is not streamable (unsurprisingly, since it is internally the same as the formulation using "!")

Actions #2

Updated by Michael Kay about 1 month ago

An observation: the spec says that given the expression (A § B) where § is union, intersect, or except, then if A and B are both striding, the result is crawling.

This is legitimate in the case of union, because for example (A/B union */*/C) can contain two nodes where one is an ancestor of the other. But it is unnecessarily restrictive for intersect and except, because with these operators, every node in the result is present in the value of the LH operand, and therefore if the LH operand is striding (contains no nested nodes) then the result is striding as well.

For union, we can make the result striding if the two operands have the same "constant depth" (the number of child selections). But the spec doesn't have the machinery to calculate the "constant depth" of an expression. In Saxon we possibly do, in the form of the path maps used for analysis of XQuery projection.

Please register to edit this issue

Also available in: Atom PDF