Hi, "Kaustubh S. Deorukhkar" <[EMAIL PROTECTED]> writes:
> Hello, Need your valuable inputs for this scenario. Any pointers would > be helpful. I have large data set (few 100s of MB or sometimes may ev > en go up to GB). I populate a DOM tree using this data set and then write t > his DOM tree to xml file. How should one handle such large data set in x > erces, as we cannot have such a large DOM tree in memory. Xerces-C++ DOM document is an in-memory data structure so unless you have enough memory you won't be able to create complete document and write it to disk. One way to approach this is to create a document for a small chunk of your data and serialize one at a time. This works well if your document has a repetitive structure, e.g., <data> <record>aaa</record> <record>bbb</record> <record>ccc</record> ... </data> which most large documents do at certain level. The way to do this with DOM is to create the top level XML structure by hand (i.e., just write it to the file as text) and write the data chunks one at a time. While I don't have a DOM example that shows how to do this, there is an example in CodeSynthesis XSD[1] (examples/cxx/tree/streaming) that shows how to do exactly that but with data-bound C++ classes instead of DOM. It uses DOM underneath so it proves that it's possible to do the same with DOM. [1] http://www.codesynthesis.com/products/xsd/ hth, -boris -- Boris Kolpackov Code Synthesis Tools CC http://www.codesynthesis.com Open-Source, Cross-Platform C++ XML Data Binding --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
