Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Parsing huge XML file

 
Satya Maheshwari
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bill!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic