You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Mauro Arcolini <ma...@dp2000.it> on 2003/04/08 10:48:14 UTC

Generate XML from scratch(with Sax events?)

Hi all,
is there a way to create and serialize a DOM document progressively with low/medium memory use?
My problem is that I can't create large DOM in memory, therefore i must serialize XML while creating it.

Maybe I have to generate my SAX events and then serialize these events with SaxPrint example?
Or are there other ways to generate XML from scratch without buildinf DOM tree and the serialize it?

Thanks for all your tips in advance,
Mauro Arcolini


RE: Generate XML from scratch(with Sax events?)

Posted by Erik Rydgren <er...@mandarinen.se>.
Well one easy way is to open a file and just do simple I/O operations on
that file.
Like: yourFile << "<root><child attribute=\"data\"/></root>";
Though you will not get free character translation and you'll have to take
care of all &gt; &amp; and so on by yourself, it is the fastest way.
Me myself have never been in favour of doing something in a complex way if I
can do it simple.

But if you need more character conversion support then the generation of SAX
events is a good alternative.

Regards

Erik Rydgren
Mandarinen systems AB
Sweden

-----Original Message-----
From: Mauro Arcolini [mailto:mauro.arcolini@dp2000.it]
Sent: den 8 april 2003 10:48
To: xerces-c-dev@xml.apache.org
Subject: Generate XML from scratch(with Sax events?)


Hi all,
is there a way to create and serialize a DOM document progressively with
low/medium memory use?
My problem is that I can't create large DOM in memory, therefore i must
serialize XML while creating it.

Maybe I have to generate my SAX events and then serialize these events with
SaxPrint example?
Or are there other ways to generate XML from scratch without buildinf DOM
tree and the serialize it?

Thanks for all your tips in advance,
Mauro Arcolini


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org