Using XPath on JDOM
843834Oct 13 2005 — edited Oct 13 2005Hi,
I am looking for am elegant way to extract data from JDOM.
I tried using org.jdom.xpath.XPath but am not sure what jars I need or what needs to be initialized before XPath works.
While execution the XPath.newInstance fails..
Element result = data.getRootElement();//partner_results
try{
XPath xpath = XPath.newInstance("/partner_results/partner_result[@name=\"Amazon\"]");
result = (org.jdom.Element)xpath.selectSingleNode(data);
}catch(Exception e){}
Is there an easy way to get this ball rolling. There does not seem to be enough documentation on using XPath on JDOM
Any pointers would be really useful.
thanks
M