Project

Profile

Help

Incorrect XPath.evaluate() return type?

Added by Anonymous over 15 years ago

Legacy ID: #6414212 Legacy Poster: Jess Holle (jess_holle)

I am trying to get Apache Solr 1.3.0 running in a context in which Saxon 9.1.0.5 is the preferred XSLT and XPath engine. Solr invokes javax.xml.xpath.XPathFactory.newInstance().newXPath().evaluate(xPathString,w3cDomDocument,XPathConstants.NODESET) and castes the result to a org.w3c.dom.NodeList. Everything I read in the javax.xml.xpath Javadoc implies that Solr is quite correct in assuming the result is a NodeList here, but I get a ClassCastException stating: java.util.ArrayList cannot be cast to org.w3c.dom.NodeList. This would certainly appear to be a Saxon bug as I read the JAXP interface documentation. Is it? If so, when might it be addressed?


Replies (2)

RE: Incorrect XPath.evaluate() return type? - Added by Anonymous over 15 years ago

Legacy ID: #6416094 Legacy Poster: Michael Kay (mhkay)

This is a known bug, see https://sourceforge.net/tracker2/?func=detail&aid=2514260&group_id=29872&atid=397617 Sorry about the inconvenience.

RE: Incorrect XPath.evaluate() return type? - Added by Anonymous over 15 years ago

Legacy ID: #6417439 Legacy Poster: Jess Holle (jess_holle)

Thanks. I tried the patch and it solves my issue. I'll look forward to a version including the patch, but until then the manual patch works just great.

    (1-2/2)

    Please register to reply