Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Writing large XML documents

xom-interest AT

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Eric Wang" <jemroc AT>
  • To: xom-interest AT
  • Subject: [XOM-interest] Writing large XML documents
  • Date: Mon, 17 Dec 2007 22:30:00 -0500

Hi, I am attempting to write an XML file larger than available memory.
Looking over the tutorial, the section describing the toXML() method
states "However, since this builds the entire document in memory, it
can be problematic for large documents and less efficient than using a
Serializer, which can stream the document."

Can someone explain how streaming using the Serializer class would
work? Looking at the Serializer class documentation, it takes a
Document object which must be built in memory first. Wouldn't this
make it consume as much memory as the toXML() method?

Searching through the archives reveals this post:,
which seems to imply that Serializer is unsuitable for streaming.
Would I need to write something like the StreamingSerializer class
referenced in that post or is the built-in Serializer capable of
streaming large documents? Appreciate if someone could clarify this
for me. Thanks.

Eric Wang

Archive powered by MHonArc 2.6.24.

Top of Page