[jdom-interest] JDOM output buffering question
Jason Hunter
jhunter at servlets.com
Mon Jan 14 21:46:12 PST 2008
Your understanding is correct. I've had occasion to output something
akin to a long log file, and it worked well to manually write the root
element start tag to the stream, then call XMLOutputter repeatedly to
output the various elements, then manually close with the root element
end tag.
-jh-
Gamble, Wesley (WG10) wrote:
> All,
>
>
>
> I am looking at generating some big-a**ed XML documents, which I then
> write out to a file. I seem to be having some issue with the document
> memory not being released.
>
>
>
> In order to output the entire document using an XMLOutputter, the entire
> document must be resident in memory, correct?
>
>
>
> What I’d like is a way to output using the XMLOutputter periodically so
> that I could use a fraction of the memory required to hold the entire
> document. However, I don’t believe that this is truly possible. It
> seems like if I wanted to do this, I would have to write out all of the
> contents of the root element using an Outputter and then “wrap” that XML
> in my root element “by hand.” (meaning using string and file
> manipulation to handle it.
>
>
>
> I’m not talking about the buffering of the call to output an entire
> document, I’m talking about using a “window” in memory to hold parts of
> the document while I continuously write it to the filesystem, so that I
> don’t need to build the entire document in memory.
>
>
>
> Hope that makes sense.
>
>
>
> Thanks for any advice,
>
> Wes
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
More information about the jdom-interest
mailing list