Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

RE: [jdom-interest] How to optimize xpath in jdom

Michael Kay

2006-12-07

Replies:

How to optimize xpath in jdom
You might find that Saxon (which is able to read JDOM as an input document) does a better job of this. In particular, Saxon-SA will build an index to support this kind of expression.
 
Michael Kay
http://www.saxonica.com/


From: jdom-interest-bounces@jdom.org [mailto:jdom-interest-bounces@jdom.org] On Behalf Of Deepa Chandrashekaraiah (RBIN/EDM2)
Sent: 07 December 2006 11:37
To: jdom-interest@jdom.org
Subject: [jdom-interest] How to optimize xpath in jdom

Hello,

I am using Xpath available in jdom. The xml file is of 9MB size. It is taking a lot of time to query a simple xpath like:

/Root/Parent/Child[name="abc"]/GrandChild

I am trying to get the value of the "GrandChild" element in the following way:
((Element)org.jdom.xpath.XPath.selectSingleNode(xml_Document, xpath_expression)).getValue();

There are many "Child" elements in my huge xml file of 9MB size. Please let me know to optimize the xpath expression or any other workarounds.

Thanks in advance.
Regards,
Chandra

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.