Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using XPath on JDOM

843834Oct 13 2005 — edited Oct 13 2005
Hi,

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 10 2005
Added on Oct 13 2005
3 comments
322 views