users@jaxb.java.net

Marshalling in chunks?

From: <eguy66_at_optonline.net>
Date: Wed, 10 Aug 2005 21:42:17 -0400

I've reviewed the thread, "Partial Marshalling", from 2003-10-15, but I don't think it completely addresses my needs. We have an application that retrieves a potentially large dataset from the database, builds a jaxb object graph, and marshalls it to xml for sending in a SOAP message to a requesting app. The xml output needs to be a well-formed xml document. The structure of the xml is basically a list of items in the form:
<policies>
    <policy>...</policy>
    <policy>...</policy>
    <policy>...</policy>
</policies>
I realize I can marshall each policy item separately, but is there a way to marshall just the start tag of <policies>, marshall each individual policy item and then marshall the ending </policies> tag (so that I have a complete, valid xml document), without building and keeping all policies in memory as a big jaxb collection, and marshalling the entire object graph? I'm looking for the logical inverse of the Partial-Unmarshalling sample, which works very well for the requestor receiving this information.
TIA,
Ed