Java Mailing List Archive

http://www.junlu.com/

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

Re: [jdom-interest] Related to JDOM - Jaxen performance and
selectSingleNode api

Elliotte Rusty Harold

2004-04-25

Replies:

At 2:17 AM -0700 4/21/04, Venkataramanan Amirthalingam wrote:
>Hi All,
>
>I am using Jaxen as the xpath engine and facing
>few performance problems.
>
>I use selectSingleNode api to get the
>Element/Attribute
>and it looks like its time-consuming.
>

Don't use selectSingleNode. It's hard to tell without knowing more
about your use case, but I suspect you can reduce this to one or a
few calls to selectNodes (Or whatever Jaxen calls that functionality)
that return a list you them iterate through, so you don't keep
searching the document every time.
--

 Elliotte Rusty Harold
 elharo@(protected)
 Effective XML (Addison-Wesley, 2003)
 http://www.cafeconleche.org/books/effectivexml
 http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.