Bug #2616
closedStreamability of pattern with call to accumulator-before()
0%
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.
Updated by Michael Kay about 8 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.
Updated by Michael Kay about 8 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.
Updated by O'Neil Delpratt about 8 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