<div dir="ltr">Paul,<br><br>Thanks for the response. My XML is really as simple as the one I posted. The 8,500 documents are retrieved over a HTTP URL. So add network latency, which makes it longer than a minute, unless my XML parser is extremely fast. Anyway, since there is probably not much I can do with the network latency, I am trying to keep the Java code as skinny and efficient as possible.<br>
<br>Would you be able to provide sample code for the solution you suggested?<br><br><div class="gmail_quote">On Thu, Oct 2, 2008 at 2:27 PM, Paul Libbrecht <span dir="ltr">&lt;<a href="mailto:paul@activemath.org">paul@activemath.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Praveen,<br>
<br>
in jdom you would just parse then take the root, then the employee, the extract last-name and ssn.<br>
It is ignoring from the point of view of your programme but not from the point of view of parsing.<br>
<br>
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 with.<br>
Another part where jdom can take too much of your CPU is if this document has loads of other stuffs.<br>
<br>
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.<br>
<br>
However, your requirements sound easy: 8500 such documents per minutes?<br>
JDOM does this probably ten times, multithreadedness not being really necessary.<br>
<br>
paul<div><div></div><div class="Wj3C7c"><br>
<br>
On 02-oct.-08, at 20:29, Praveen Gattu wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">
I have a XML as below. There is always &quot;only one&quot; 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 &nbsp;(multi-threaded of course) and need something efficient and fast. I appreciate any help you can offer in this regard.<br>

<br>
&lt;response&gt;<br>
 &nbsp;&lt;employee&gt;<br>
 &nbsp; &nbsp;&lt;firstname&gt;John&lt;/firstname&gt;<br>
 &nbsp; &nbsp;&lt;lastname&gt;Smith&lt;/lastname&gt;<br>
 &nbsp; &nbsp;&lt;ssn&gt;111-11-1111&lt;/ssn&gt;<br>
 &nbsp;&lt;/employee&gt;<br>
&lt;/response&gt;<br>
<br>
-- <br>
Thanks,<br>
Praveen<br>
<br>
<br>
<br>
<br>
-- <br>
Thanks,<br>
Praveen<br>
</div></div>_______________________________________________<br>
To control your jdom-interest membership:<br>
<a href="http://www.jdom.org/mailman/options/jdom-interest/" target="_blank">http://www.jdom.org/mailman/options/jdom-interest/</a><a href="mailto:youraddr@yourhost.com" target="_blank">youraddr@yourhost.com</a><br>
</blockquote>
<br>
</blockquote></div><br><br clear="all"><br>
</div>