[jdom-interest] Re: Reading XML with JDOM

Paul Libbrecht paul at activemath.org
Thu Oct 2 14:27:19 PDT 2008


in jdom you would just parse then take the root, then the employee,  
the extract last-name and ssn.
It is ignoring from the point of view of your programme but not from  
the point of view of parsing.

Where you can save is by changing the xml technology... if your  
document is as simple as below then using sax has greater performance  
guarantees (you really cannot go faster) but is harder to programme  
Another part where jdom can take too much of your CPU is if this  
document has loads of other stuffs.

Where JDOM would make a positive difference is at walking more  
elaborate xml documents, which is the norm, and at manipulating them.  
The expressivity of the library there is unbeatable to my taste.

However, your requirements sound easy: 8500 such documents per minutes?
JDOM does this probably ten times, multithreadedness not being really  


On 02-oct.-08, at 20:29, Praveen Gattu wrote:

> I have a XML as below. There is always "only one" employee node in  
> the XML. So rather than iterating through the nodes, I want to read  
> the lastname and ssn directly, while ignoring the firstname. What is  
> the best way to do this in JDOM? My most important criteria is  
> speed. We will be processing about a 8,500 of such XML documents per  
> minute  (multi-threaded of course) and need something efficient and  
> fast. I appreciate any help you can offer in this regard.
> <response>
>   <employee>
>     <firstname>John</firstname>
>     <lastname>Smith</lastname>
>     <ssn>111-11-1111</ssn>
>   </employee>
> </response>
> -- 
> Thanks,
> Praveen
> -- 
> Thanks,
> Praveen Gattu
> 303-880-7455
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/ 
> youraddr at yourhost.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2203 bytes
Desc: not available
Url : http://www.jdom.org/pipermail/jdom-interest/attachments/20081002/d3e17886/smime.bin

More information about the jdom-interest mailing list