Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#136 Crash in XPathEvaluator

v7.4
closed
Michael Kay
5
2012-10-08
2003-04-15
Michael Kay
No

This bug affects applications using Saxon's XPath API only.

Saxon fails with a ClassCastException when using the
evaluate() method of the XPathEvaluator class. The
particular circumstance was a filter expression that
compared [@att=$var], but it could happen with any
expression, because the code for type checking and type
conversion (including atomization) is not being added
to the raw compiled expression.

Workaround: use

exp = xpp.createExpression("....");
result = exp.evaluate();

Source code fixed. Add the following to
XPathEvaluator#evaluate() (line 212)

exp = exp.typeCheck(staticContext);

Affects Saxon 7.x only.

Test case: users\filer\Tree.java

Discussion