Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Classes for XML Building  RSS feed

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have written a program for creating XML documents which uses the Document and DOM classes. The problem I face is when a large of data needs to be stored in the XML file. The program terminates throwing a OutOfMemory error. I earlier used the Document class to read an already generated XML file but this also used to give me the same error so I started using SAXParser. My question is, is there a light-weight XML document builder to avoid such errors being thrown up? Any kind of help is welcome.
 
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A DOM occupies much more space than the data it represents since it creates so many objects.

The simplest XML document builder is to just use print statements to write the tags and contents. If you organize your architecture so that objects represent reasonable chunks of the XML hierarchy, and "know how" to write their contents, it is pretty straightforward.

Bill
 
Ketan KC Chachad
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had read long time before that SAXParser can be used to create XML documents. Is it true? If yes, can you give me the links for reading on it.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!