Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.7
-
None
-
None
-
Java 5
Description
When calling XPathExpressionImpl.evaluate(Object item, QName returnType), if item is of type NodeList, a ClassCastException is thrown.
I've looked at the source code. The problem seems to happen in XPathExpressionImpl.eval(Object contextItem). There is a section of code that reads:
Node contextNode = (Node)contextItem;
// We always need to have a ContextNode with Xalan XPath implementation
// To allow simple expression evaluation like 1+1 we are setting
The type cast is what causes the exception. Is there a fix or a work-around for this?