ClassCastException: net.sf.saxon.expr.instruct.CopyOf cannot be cast to net.sf.saxon.expr.AxisExpression
In a rather complicated setup of using XSLT to transform a Schematron schema to streamable XSLT and then run that against an input document to be validated against the Schematron schema I run into a
java.lang.ClassCastException: net.sf.saxon.expr.instruct.CopyOf cannot be cast to net.sf.saxon.expr.AxisExpression with both Saxon 10.2 EE and 126.96.36.199 EE.
The stack trace is
java.lang.ClassCastException: net.sf.saxon.expr.instruct.CopyOf cannot be cast to net.sf.saxon.expr.AxisExpression at net.sf.saxon.expr.SlashExpression.lambda$iterate$0(SlashExpression.java:948) at net.sf.saxon.expr.MappingIterator.next(MappingIterator.java:60) at net.sf.saxon.om.SequenceIterator.forEachOrFail(SequenceIterator.java:135) at net.sf.saxon.expr.Expression.process(Expression.java:949) .....
#1 Updated by Michael Kay 9 months ago
In the path expression on line 33, the
.../node() has been rewritten as
.../copy-of(node()), as part of the process of generating a streamable execution plan. The node will be copied because it's being transferred to a new parent at line 37, and so this makes the copy explicit because that makes the streamability analysis work. But the path expression has a flag
contextFree set; this is set when it's possible to evaluate the rhs of the path expression without creating a new context, but it assumes the rhs will be an
Please register to edit this issue