> As regards this snippet: > > >>>(Note: If you're passing in a DOM, ****STOP*** > -- instead, pass in a SAX stream, and let us construct a DTM.)<<< > > If you already have a DOM in hand, is there any benefit in > serializing it into a stream?
If you pass us a DOM, all we can do right now is wrap a DTM adapter around it -- which is unavoidably going to be larger than the DOM and probably make any memory constraints that much worse. Serializing out and parsing into a DTM is going to be expensive, but *may* reduce memory thrash during transformation and thus may be a net win. (Moreso if you release the DOM from memory before building the DTM, of course.)