It's not at all clear to me what you want to achieve, but I would think there are many avenues to explore before you contemplate changing the Saxon source code.
For example, it's easy to write a SAX filter that combines many documents into one; the SAX filter can then feed the combined document into Saxon by (for example) use of the JAXP TransformerFilter interface. But this wouldn't achieve any significant memory saving: Saxon will build a tree for the combined document, which will be about the same size as the trees for the individual documents considered separately.
If you're after memory saving, then consider accessing the documents as a collection (using the collection() function), and discarding each one after processing by using the saxon:discard-document() extension.


Michael Kay

From: roman.sova []
Sent: 25 March 2010 18:23
Subject: [saxon] Processing multiple SAXSources with a single xslt

I am looking for a way to extend Saxon Controller to process multiple documents with the same xslt instead of passing parameters and looping over each document. The product is merged xml that transformed with an xslt. The focus is to process multiple documents as a single xml. I am concern with memory use when I concatenate several (up to 40) large xml documents building a single document source. I found a DocumentPool object and it looks like a good place to store multiple documents for processing. Please advice to where in framework is the best place to implement this costume feature.

View this message in context: Processing multiple SAXSources with a single xslt
Sent from the saxon-help mailing list archive at