• 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!