aspose file tools*
The moose likes XML and Related Technologies and the fly likes Parsing huge XML file 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 "Parsing huge XML file" Watch "Parsing huge XML file" New topic
Author

Parsing huge XML file

Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
Hi All
I have a requirement to read ,write and modify, huge XML documents whose size may be several MBs or a couple of GBs too. Is there an efficient way of doing this. I think placing whole of it 'in memory' like in JDOM document is surely going to lead to 'Out of memory'. Any help is greatly appreciated.
Regards
Satya Deep


Thanks and Regards
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
With huge files, as you said, the DOM approach will not fit in memory so you are looking at using an event processing style like SAX.

Depending on your exact problem you may find the ServingXML toolkit will help.

The SmallX toolkit is another possibility.

By all means read Harold's free online chapter on SAX filters.

Bill
Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
Thanks Bill!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Parsing huge XML file