Yes, STX is an alternative approach, but it should be possible to achieve this using a TransformerHandler. I've replied on the forum.
Michael Kay

From: [] On Behalf Of Roger Kovack
Sent: 13 May 2004 00:42
Subject: [saxon] Re: [saxon - Help] RE: XMLFilters to split documents (was: preview)

Don't people use STX do things like this? I'm pondering the same thing and I believe STX is a SAX-based Xpath-driven filter that supposedly runs gigantic documents in almost no memory space. I've heard Mike suggest it.

Roger Kovack wrote:
Read and respond to this message at:
By: gschadow

This task is a conundrum. I am chewing on this for several hours now with no
workable solution in sight.

What I want is a single filter pipeline where one node in the chain transforms
smaller sub-documents of a big document to avoid building a humongous tree.

The problem is that at the point when we catch the startElement event of the
node that should become the top node of the sub-document, we need to return
right away in order for anything to move forward. However, the only way to invoke
a Transformer is using the synchronous transform method, which will block.

Somehow the parent XML parser must receive back the control from startElement
and still the Transformer must be initialized and ready to become the ContentHandler
for the next event.

This seems not possible. That's bad. 

Either the Controller should allow multiple documents to come down the pipeline
or we need an asynchronous mode of invoking it, e.g.,

Transformer transformer = transformerFactory.newTransformer(new

startElement(...) {

if(...) // second level element
SAXResult result = new SAXResult();

ContentHandler contentHandler = transformer.getReadyForSAXEvents(result);



How hard would it be?


You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to and visit:

------------------------------------------------------- This SF.Net email is sponsored by: Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! _______________________________________________ saxon-help mailing list