[XOM-interest] Writing large XML documents
Eric Wang
jemroc at gmail.com
Mon Dec 17 22:30:00 EST 2007
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:
http://lists.ibiblio.org/pipermail/xom-interest/2007-October/003560.html,
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
More information about the XOM-interest
mailing list