Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Slow processing when Parsing XML files

843834Jan 22 2005 — edited Jan 25 2005
Hi

I have written a utility in Java (using JAXP) which parses an .xml file. This xml file
contains references to n number of other xml files. From here I direct the parser to each of these individual xml files where it searches for elements with a particular tag name, lets say 'node'. As in,

<node name= "Parent A">
<entry key="type" value="car"/>....
</node>
.....
.....
<node name= "Parent B">
<entry key="type" value="Truck"/>
</node>

I am collecting all the 'nodes' from these n xml files and then finally building a single xml file which will contain only the 'node' and its attribute 'name' value. As in,

<node name="Parent A"/>
<node name="Parent B"/>

In most cases n is a number greater than 100. Each of these n xml file have LOC exceeding 2 to 3000.

NOW the issue is, the xml parser takes more than an hr to go through just 10 - 15 xml files , collects the 'node', and building a new DOM object which I finally get published using Xml Transformer.

In effect , it beats the whole purpose of writing this utility as no programmer will stick around for an hr to to watch it happen/finish.

Apart from maybe further fine tuning my logic, which I've almost exhusted, is there any 'faster' way of doing the whole thing.

Please reply. Any comment would be greatly appreciated.

I am using JAXP 1.3 specs to parse and build the DOM.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 22 2005
Added on Jan 22 2005
5 comments
268 views