Bug #5823
closedThe implemented fn:slice function signature differs from the Saxonica docs and the specification
100%
Description
Using the attached XSLT 4.0 - with extensions enabled - with SaxonJ 12.0 PE:
When running the attached XSLT (test.xsl) from the command-line against itself I get the following error:
Error in xsl:variable/@select on line 9 column 76 of test.xsl:
XPTY0004 The required item type of the second argument of fn:slice() is map(*)
Errors were reported during stylesheet compilation
Further tests showed that fn:slice must have 2 arguments: item()* and map(*) - the Saxon 12 documentation (and the spec) however indicate 4 arguments can be supplied - with the last 3 optional:
fn:slice($input as item()*, $start as xs:integer?, $end as xs:integer?, $step as xs:integer?) as item()*
Files
Updated by Michael Kay almost 2 years ago
Yes, the spec here is in flux and we should drop the function until it stabilises.
Updated by Michael Kay almost 2 years ago
I think the fn:slice() implemented in 12.0 is actually a synonym of saxon:slice as described at
https://www.saxonica.com/documentation12/index.html#!functions/saxon/slice
Updated by Michael Kay almost 2 years ago
We discussed policy on keeping 12.x maintenance releases up to date with the changing 4.0 specs, and decided that the general approach should be to keep as close to the changing spec as possible regardless of compatibility issues.
Updated by Michael Kay almost 2 years ago
- Status changed from New to Resolved
- Applies to branch 12, trunk added
- Fix Committed on Branch 12, trunk added
- Platforms .NET, Java added
The current implementation of fn:slice() is unusable (the signature expects a map as the second argument, while the code expects an integer or sequence of integers), so I am dropping the function from the product and the documentation.
Updated by O'Neil Delpratt almost 2 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 12.1 added
Bug fix applied in the Saxon 12.1 maintenance release.
Please register to edit this issue