Should a positional pattern match="p[1]" or match="p[last()]" be rejected by the streamability analysis?
Added by Martin Honnen over 7 years ago
https://www.w3.org/TR/xslt-30/#classifying-patterns gives some examples about "patterns that are not motionless", one of them being @p[1]@ as a "a positional predicate: return type is numeric", another being @p[last()]@.
I am kind of surprised that Saxon (tested with @Saxon-EE 9.8.0.3J@ from the command line) does not reject a stylesheet with such a pattern as not streamable but only gives a run-time exception "java.lang.UnsupportedOperationException: net.sf.saxon.trans.XPathException: Navigation using child axis is not supported from a streamed input node".
Is that in line with the XSLT 3.0 spec or a known problem with 9.8?
Simplest XSLT I could come up with is
with an input like
1
2
3
or the same input and then
for the @last()@ test.
Replies (1)
RE: Should a positional pattern match="p[1]" or match="p[last()]" be rejected by the streamability analysis? - Added by Michael Kay over 7 years ago
Sorry for the delay in responding. I'm not quite sure where and when this got fixed, but the current development build on the Saxon 9.8 line is getting this right.
Historically supporting streaming on @p[1]@ was a Saxon streaming extension, but it was abandoned quite a while ago (though I think it lingered in the documentation for a while after disappearing from the product).
Please register to reply