Project

Profile

Help

Bug #2225

closed

Optimization of filter expressions in 1.0 mode

Added by Michael Kay over 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT conformance
Sprint/Milestone:
Start date:
2014-11-19
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.6
Fix Committed on Branch:
9.6
Fixed in Maintenance Release:
Platforms:

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

Also available in: Atom PDF