File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes About XML parser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "About XML parser" Watch "About XML parser" New topic

About XML parser

lei jiong

Joined: Oct 30, 2003
Posts: 1
Hello, our team is doing a JAVA project which needs to use XML to store all the data. In this project, we need not only to read data from XML files, but also write to XML files. In addtion, some of XML files are very big, which might have 1000 rows, more than 30000 nodes. Currently, we are using DOM to parse XML files, but it takes too long to get data, and some times, out of memory. We have thinked about JDOM, but it also has to build the entire tree to the memory, which might cause the memory problem. And SAX can not update the data.
Do some body have good suggetions for us to improve our project?
Balaji Loganathan
author and deputy

Joined: Jul 13, 2001
Posts: 3150
Originally posted by lei jiong:
some XML files are very big, which might have 1000 rows, more than 30000 nodes.

Just wondering why you went for XML to carry such big data instead of using standard database approach.
In any case, please check data binding tools like Castor or Jbind, which is capable of processing large files in an efficient way.

Spritle Software Blogs
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
With respect to your statement:
And SAX can not update the data.

Exactly what kind of update do you want to do?
You can use SAX events to write a new database XML file on the fly. If your update changes are simple, such as changing a few attributes or the contents of an element, they can also be done on the fly. The advantage being that the memory requirement will be much less and speed greater.
I agree. Here's the link:
subject: About XML parser
It's not a secret anymore!