xpath-api

Which XPathAPI should I use in Java 1.5?

I have been using com.sun.org.apache.xpath.internal.XPathAPI for some time and it seems to work ok. Recently I tried to use the TPTP profiler in Eclipse but it could not find the XPathAPI class. I haven't figured this problem yet but it did make me wonder whether I should be using a class in an 'internal' package? Should I be using the ...

String javax.xml.xpath.XPathExpression.evaluate(Object item) guarantees it never returns null in all implementations?

From the JavaDoc: returns: The String that is the result of evaluating the expression and converting the result to a String. /** * ... * ... * @return The <code>String</code> that is the result of evaluating the expression and converting the result to a * <code>String</code>. * ... * ... */ String javax.xml.xpath.XPathExpressi...

Saxon XPath API returns TinyElementImpl instead of org.w3c.dom.Node

I have the following code: // xpath evaluates to net.sf.saxon.xpath.XPathEvaluator XPath xpath = XPathFactory.newInstance().newXPath(); XPathExpression expression = xpath.compile("/foo/bar"); Object evaluate = expression.evaluate(someXML, XPathConstants.NODE); Object evaluate2 = expression.evaluate(someXML, XPathConstants.NODESET); S...