Hello,
I'm sure this is a naive Xalan J question, but I'll give it a shot.
When the Transformer.transform(Source, StreamResult) method is
called, how is the source XML processed? Is the entire XML document loaded,
and then transformed, or is the XML processed some number of elements at a
time, and the result streamed out incrementally?
Say I'm reading from a database. The model I've got stuck in my head
is that it should be simple for me to interate over my result set and 'push'
the result XML to a transformer as the XML is being generated, say one
record at a time. So, it would be nice if the Transformer (or a Transformer
like class) wrapped an output stream or writer.
From the API I've seen, I will need to wrap my database record
retrieval as an input stream or reader to be used as a Source. This looks
fairly awkward if the XML generation procedure is
complex.
What I'm trying to achieve is a stream, with no buffering of the
entire data set along the transformation (database -> XML (XSL transform)
-> result). Is this achievable?
If
the Transformer buffers the XML, then it doesn't matter, and I will do
something simple like writing my result XML to a file before calling
'transform'.
Thanks,
Dave