Project

Profile

Help

Should use of "path()" function in streamable mode give a run-time exception or a compile-time error?

Added by Martin Honnen almost 8 years ago

When using the XPath function @path()@ in a streamable mode, as in



	
	
	
	
	
	
		
		
	
	

Saxon (tested with Saxon-EE 9.7.0.6J from the command line) gives a run-time exception

java.lang.UnsupportedOperationException: net.sf.saxon.trans.XPathException: Navigation using preceding-sibling axis is not supported from a streamed input node

which I understand and which makes sense, but I wonder whether the streamability analysis should not catch this at compile-time.


Replies (1)

RE: Should use of "path()" function in streamable mode give a run-time exception or a compile-time error? - Added by Michael Kay almost 8 years ago

Good catch. In the spec the first argument of path#1 is correctly classified as operand-usage="N" (navigation) but in Saxon it has been listed as operand-usage="I" (inspection). This may be because at one stage Saxon (and indeed the spec) maintained a preceding-sibling counter for streamed nodes, which would be sufficient to make the path() function streamable.

    (1-1/1)

    Please register to reply