>>>>> "Fabien" == Azavant, Fabien <[EMAIL PROTECTED]> writes:
Fabien> I am trying to transform pretty big XML files with
Fabien> xalan. But the transformations are very simple, and once a
Fabien> node is closed, it is never visited again. For example, I
Fabien> need to aggregate 2 nodes in the source document into 1 node
Fabien> in the result document.
Fabien> Even with a sax input and sax output, xalan seems to build
Fabien> an internal structure to hold the entire document. Whereas I
Fabien> do not need that. I thought that the advantage of SAX over
Fabien> DOM was that the entire document is not brought into memory.
This depends on what the application does with the SAX events
or the DOM tree. Both are just interfaces, and neither specify what
happens inside the parser or outside it.
Fabien> Is there a way to tell xalan not to build an in-memory
Fabien> structure of the document ?
Fabien> That would be great and I could handle my 1Gb file !
I think the Xalan is always going to build an in-memory
representation, although I could be wrong about this (no doubt someone
else will tell you a more definitive answer). A moot question here
though is if your transformation is so simple, do you really want to
be using XSLT. You could just write a small class which performs the
operation directly on the SAX stream. That way you can control what is
held in memory and what is not.
Phil