  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | How to optimize xpath in jdom | How to optimize xpath in jdom 2006-12-07 - By Deepa Chandrashekaraiah (RBIN/EDM2)
Back 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"> <META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7650.28"> <TITLE>How to optimize xpath in jdom</TITLE> </HEAD> <BODY> <!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Hello,</FONT> </P>
<P><FONT SIZE=2 FACE="Arial">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:</FONT> </P>
<P><FONT SIZE=2 FACE="Arial">/Root/Parent/Child[name="abc"] /GrandChild</FONT> </P>
<P><FONT SIZE=2 FACE="Arial">I am trying to get the value of the " ;GrandChild" element in the following way:</FONT>
<BR><FONT SIZE=2 FACE="Arial">((Element)org.jdom.xpath.XPath.selectSingleNode (xml_Document, xpath_expression)).getValue();</FONT> </P>
<P><FONT SIZE=2 FACE="Arial">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.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Thanks in advance.</FONT>
<BR><FONT SIZE=2 FACE="Arial">Regards,</FONT>
<BR><FONT SIZE=2 FACE="Arial">Chandra</FONT> </P>
</BODY> </HTML> __ ____ ____ ____ ____ ____ ____ ____ ____ ____ To control your jdom-interest membership: http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
|
|
 |