Project

Profile

Help

Bug #2616

closed

Streamability of pattern with call to accumulator-before()

Added by Michael Kay over 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Streaming
Sprint/Milestone:
-
Start date:
2016-02-13
Due date:
% Done:

0%

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

Description

The pattern

match="part[map:contains(accumulator-before('selected-part-ids'), @id)]"

causes a template rule to be deemed non-streamable on the grounds that the pattern is not motionless. This appears to be incorrect according to the W3C streamability analysis.

Actions #1

Updated by Michael Kay over 6 years ago

  • Status changed from New to Resolved

The code in Expression.toPattern() is creating a GeneralNodePattern, and a GeneralNodePattern is always deemed to be not motionless. The reason a GeneralNodePattern is used is that the predicate passes the test isPositionalFilter(getFilter(), th). This code is returning true if the filter includes a call on a system function that is registered as focus-dependent. This test is too strong; we should only be considering whether there is a dependency on position() or last().

I have refined the data in the StandardFunctions table so that dependencies on the context item, position, and size are captured separately, rather than being bundled into a single dependency on the focus. This has solved the problem for this test case (stream-201), though we need to regression test it carefully.

Actions #2

Updated by Michael Kay about 6 years ago

To pass the stream-20x test cases, a further fix was necessary to set the type information for the variable bound to current(), since

text()[$x = current()]

is motionless, but

xxx[$x = current()]

is consuming.

Actions #3

Updated by O'Neil Delpratt about 6 years ago

  • Fix Committed on Branch 9.7 added
Actions #4

Updated by O'Neil Delpratt about 6 years ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release 9.7.0.3 added

Bug fix applied in the Saxon 9.7.0.3 maintenance release.

Please register to edit this issue

Also available in: Atom PDF