According to the W3C recommendation, an XPahEvaluator object could be
obtained by a cast of a Document implementation, if the DOM implementation supports the DOM 3 XPath feature.
My DOM implementation is xerces 2.6.2 and at the question
impl.hasFeature("XPath", "3.0")the response is true.
Then, the following code should be ok :
doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputsource);
XPathEvaluator evaluator = (XPathEvaluator) doc;
XPathResult result = (XPathResult) evaluator.evaluate(xpath, doc,...
right ?
But I've got [java] java.lang.ClassCastException [java] at test.XPathW3C.evalXpath(Unknown Source) [java] at test.XPathW3C.main(Unknown Source) [java] Exception in thread "main" [java] Java Result: 1
while
XPathEvaluator evaluator = new
org.apache.xpath.domapi.XPathEvaluatorImpl(doc);works fine.
So my question is : this error is the consequence of the immature implementation of DOM 3 XPath recommendation ? and will it work as described in my first example ?
thanks in advance.
regards
-- XPath free testing software : http://www.opikanoba.org/lantern/ Fr�d�ric Laurent http://www.opikanoba.org
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
