Bug #2225
closedOptimization of filter expressions in 1.0 mode
100%
Description
Saxon-EE attempts optimization of filter expressions having the form $xxx[@id = $yyyy]. The optimization builds an index and uses this index to speed up evaluation of the expression. This optimization should not be attempted if the stylesheet is running in XSLT 1.0 backwards compatibility mode (i.e. if the stylesheet specifies version="1.0", because the semantics of general comparisons are then different (for example, if $yyyy is a boolean value true/false, then the test selects $xxx values for which @id is present/absent). However, the optimization is attempted, and may cause incorrect behaviour: either incorrect results, or a subsequent compile-time failure such as:
java.lang.ClassCastException: net.sf.saxon.expr.GeneralComparison10 cannot be cast to net.sf.saxon.expr.ComparisonExpression
at com.saxonica.ee.optim.IndexedFilterExpression.replaceOperand(IndexedFilterExpression.java:252)
at net.sf.saxon.expr.Expression.simplify(Expression.java:139)
Please register to edit this issue