Bug #4029
closedsaxon:path() is broken in 9.9
100%
Description
I see that saxon:path() has been obsolete since fn:path() was introduced. However, it was working in 9.8 but appears to be entirely broken in 9.9 (Saxon-PE 9.9.0.2J) as I discovered when running an older XSLT transform. For the simple test files attached, 9.8 produces the expected message:
Found a nugget at /doc/p[3]/i[1]
while 9.9 outputs
Found a nugget at /doc/p187/i185
If it is not worth fixing perhaps it should simply be removed?
Files
Related issues
Updated by T Hata about 6 years ago
Also I encountered a weird expression like that in an error message.
Error at char 9 in xsl:template/@match on line 44 column 82 of foo.xsl:
XTTE0780: An error occurred matching pattern
...
in built-in template rule for /html/body185/div186/div186/div187/div185/div185/div188/div185/div185 in the unnamed mode
in built-in template rule for /html/body185/div186/div186/div187/div185/div185/div188/div185 in the unnamed mode
in built-in template rule for /html/body185/div186/div186/div187/div185/div185/div188 in the unnamed mode
in built-in template rule for /html/body185/div186/div186/div187/div185/div185 in the unnamed mode
in built-in template rule for /html/body185/div186/div186/div187/div185 in the unnamed mode
in built-in template rule for /html/body185/div186/div186/div187 in the unnamed mode
in built-in template rule for /html/body185/div186/div186 in the unnamed mode
in built-in template rule for /html/body185/div186 in the unnamed mode
in built-in template rule for /html/body185 in the unnamed mode
in built-in template rule for /html in the unnamed mode
Updated by Michael Kay about 6 years ago
- Status changed from New to Resolved
- Assignee set to Michael Kay
- Priority changed from Low to Normal
- Fix Committed on Branch 9.9 added
Interesting how this bug happened: the Saxon 9.8 code (in Navigator.getPath())
return pre + '/' + node.getDisplayName() + '[' + getNumberSimple(node, context) + ']'
became in 9.9
return pre + '/' + node.getDisplayName() + (streamed ? "" : '[' + getNumberSimple(node, context) + ']');
The change was made so that getPath() returns something useful when streaming (when sibling position is not available), but it fell foul of Java's silly overloading of the "+" operator (and implicit conversion of char to int).
In fact I think this change was made as part of a bug fix, and it's possible that it would have been revealed if we tested maintenance releases as thoroughly as we test major releases.
So, the fix is trivial. Thanks for reporting it.
Updated by Michael Kay about 6 years ago
I established that the only tests for saxon:path are in the so-called "original" test suite, consisting of old tests that we don't run very often because checking the results is a manual process. I will attempt to migrate them to xslt30extra.
Updated by Michael Kay about 6 years ago
Test case path-026 added to xslt30extra. This revealed that the first patch was inadequate; it only fixed the problem for element nodes, but the same problem was present for other node kinds.
Updated by Michael Kay almost 6 years ago
- Has duplicate Bug #4073: Invalid XPath expression in error message added
Updated by O'Neil Delpratt almost 6 years ago
- % Done changed from 0 to 100
- Fixed in Maintenance Release 9.9.1.1 added
Bug fix applied to the Saxon 9.9.1.1 maintenance release.
Updated by O'Neil Delpratt almost 6 years ago
- Status changed from Resolved to Closed
Please register to edit this issue