Bug #3758
closed
Saxon 9.8 position()'s "context" regression
Applies to branch:
9.8, trunk
Fix Committed on Branch:
9.8, trunk
Fixed in Maintenance Release:
Description
When using XPath 2.0 if and satisfies structures in conjunction with position() my stylesheet generates different output in PE 9.7.0.21 and HE 9.8.0.8.
The position() might operate in a different context in 9.8.
Sorry, if this change relates to the XSLT/XPath 3.0 implementation.
Files
test.xsl (697 Bytes)
test.xsl |
Test stylesheet demonstrating the issue |
Andy Yar, 2018-04-24 16:07
|
|
test.xml (215 Bytes)
test.xml |
Test input mimicking a real data structure |
Andy Yar, 2018-04-24 16:07
|
|
- Category set to Internals
- Status changed from New to In Progress
- Assignee set to Michael Kay
- Priority changed from Low to Normal
Thanks for reporting it.
It appears to be a problem with the new code for loop-lifting optimizations that was introduced in Saxon 9.8. The expression "position() = 1" is being lifted out of the "some ... satisfies ..." loop, meaning that it is only evaluated once on the first iteration of the loop. But this involves saving the dynamic context of the expression, and the code for saving the dynamic context is not written to handle expressions that depend on the value of position() or last().
- Status changed from In Progress to Resolved
- Applies to branch trunk added
- Fix Committed on Branch 9.8, trunk added
Changed expression.isLiftable() to return false if the expression depends on position() or last().
Added W3C test case position-8301.
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 9.8.0.12 added
Bug fix applied in the Saxon 9.8.0.12 maintenance release.
Please register to edit this issue
Also available in: Atom
PDF