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

Elliotte Rusty Harold elharo at metalab.unc.edu
Sun Apr 25 06:32:39 PDT 2004


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 at metalab.unc.edu
   Effective XML (Addison-Wesley, 2003)
   http://www.cafeconleche.org/books/effectivexml
   http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA



More information about the jdom-interest mailing list