Is there some API using which I can modify a very large XML file? DOM goes out of memory and SAX just doesn't fit the bill.

Chandra Patni

One of the upcoming polular API for XML parsing is JDOM (www.jdom.org). It is a sort of hybrid approach between DOM and SAX. JDOM API lets you use either DOM or SAX parser under the hood and uses the power of Java collection API which makes XML parsing a lot more easier. JDOM also let's you create your own XML document from scratch and modify original XML document by using either SAX or DOM API under the covers. JDOM API's SAXBuilder class is probably fits the bill for parsing a very large XML document which uses SAX API for parsing and allows you to modify the document at the same time.

To get started on JDOM, you can refer to articles published at javaworld.com.
Article 1
Article 2

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact