hi Vladimir, Take a look at examples/SAXPrint/SAXPrintHandlers.cpp.
The SAXPrintHandlers class utilizes the XMLFormatter class to do the grunt work of escaping reserved chars, etc. by specifying certain formatting flags while writing. The SAXPrintHandlers contains a reference implementation for all SAX events. Maybe you can use the SAX interface of the class as your serialization interface. It should be fast. Additionally you can use a buffered output (XMLFormatTarget) if the number of I/O ops is a bottleneck. Tobias ----- Original Message ----- From: Vladimir Loubenski To: [email protected] Sent: Monday, April 05, 2010 5:03 PM Subject: RE: Problem writing large XML file My own serialization procedure can be workaround. But this approach will require large amount of low level coding (writing xml tags, replacement for some characters, etc.) ... Does exist some library that helps to implement such approach? Thank you in advance for any information. Regards, Vladimir. -----Original Message----- From: Vitaly Prapirny [mailto:[email protected]] Sent: April 2, 2010 2:49 AM To: [email protected] Subject: Re: Problem writing large XML file Hi, Vladimir Loubenski wrote: > I have large amount of data (more than computer RAM) that I need to > wrote to XML file. > How can I do that? It's not a problem for me to use another than DOM > API but I can not find any. For example SAX only for reading. In most of the modern operating systems the memory a process can use is not bounded by RAM size. But if the data size is really huge (or for performance reasons) you could use you own serialization procedure instead of the DOM API. Traverse your data and write it out with xml tagging. And don't forget to replace some special characters with predefined entities like "<", ">", etc. Good luck! Vitaly --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
