• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

About XML parser

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
Thanks!
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
castor: http://www-106.ibm.com/developerworks/xml/library/x-bindcastor/
jbind:http://java.sun.com/xml/jaxp/dist/1.0.1/docs/binding/DataBinding.html
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
Bill
reply
    Bookmark Topic Watch Topic
  • New Topic