partial in-memory streaming example (was: [xsd-users] XSD 3.3.0 released)

Eric Niebler eric at boostpro.com
Wed Apr 28 18:07:36 EDT 2010


On 4/28/2010 3:00 AM, Boris Kolpackov wrote:
>   * The streaming example has been extended to show how to perform stream-
>     oriented, partially in-memory XML processing using the C++/Tree mapping.
>     With the partially in-memory parsing and serialization only a part of
>     the object model is in memory at any given time. With this approach one
>     can process parts of the document as they become available as well as 
>     handle documents that are too large to fit into memory.

I got very excited when I read this because my application is running
out of memory when serializing large DOM's. I had a look at this
example, but sadly it doesn't look like it will solve my problem.

IIUC, you're doing incremental DOM serialization by loading a shell for
the root, and then serializing children of the root one at a time. That
works for large documents that are flat; that is, most of their content
are direct children of the root. But what about deeply nested documents?
Is there a way to incrementally parse/serialize such a document using
the C++/Tree mapping?

Aside: it looks like the XSD serialization routines are first
serializing XSD DOM to xerces DOM, and then using xerces routines to
serialize this to XML. Serializing to xerces DOM is where my app runs
out of memory -- sad because it seems like this step could be eliminated
entirely if there were some way to go straight from XSD DOM to XML.
Thoughts?

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com



More information about the xsd-users mailing list