Help trying to convert old Apache XPath methods to J2SE5 XPath
Previously using Apache XPath before it was part of J2SE I loaded the xml file into a DOM Document, and then had a method that could lookup by xpath
DocumentBuildFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setValidating(false);
DocumentBuilder db = dbf.newDocumentBuilder();
Document d = db.parse(new File("testfile.xml");
......
node = XPathAPI.selectSingleNode(d.getDocumentElement(),xpath);
return node;
but in the J2SE, XPath only seems to work with (SAX) Input Source, I don't see why It can't be run against a DOM Document.
XPathFactory xpf = XPathFactory.newInstance();
XPath path = xpf.newXPath();
....
XPathExpression xPathExpression = path.compile(xpath);
return xPathExpression.evaluate(is);
Could anybody clarify this for me, thanks Paul

