Philip, 
Thank you very much for the example, and the helpful notes. Exactly what i was hoping for, and it worked perfectly (given your API warning, it probably works fine for me because i removed the third stylesheet transform).

This is much simpler than the other methods i've used. As someone who does not live in JAVA, i found setting up the Cocoon environment to do the same thing your example does a bit nightmarish. When our validation service (for biomedical researchers submitting human mutation data into the public domain) is online, i will write a brief tutorial around how we used your example, highlighting how much easier it is. I'll post that here when ready.

Thanks again for the assistance,
- Myles
--
Myles Byrne
IT Specialist
The Institute for Molecular Medicine Finland 


Date: Tue, 19 Feb 2013 19:18:21 +0000
From: Philip Fearon <pgfearo@googlemail.com>
Subject: Re: [saxon] Saxon-CE pipeline examples
To: Mailing list for the SAXON XSLT and XQuery processor
<saxon-help@lists.sourceforge.net>
Message-ID:
<CADV2FzQzJWh_0uQE1YyTotini2xDNapkbFSTrWKGFMsujVpH=g@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Here's a simple HTML file with JavaScript that runs an XSLT
transformation pipeline with 3 style sheets, stage1.xsl, stage2.xsl
and stage 3.xsl:

<!DOCTYPE html>
<html>
<head>
<title>cepipe</title>
<script type="text/javascript" language="javascript"
src="../Saxonce/Saxonce.nocache.js"></script>
<script type="text/javascript" language="javascript">

onSaxonLoad = function() {
   var proc1 = Saxon.newXSLT20Processor(Saxon.requestXML("stage1.xsl"));
   var proc2 = Saxon.newXSLT20Processor(Saxon.requestXML("stage2.xsl"));

   proc1.transformToDocument(Saxon.requestXML("input.xml"));
   var rd1URI = proc1.getResultDocuments()[0];
   var rd1Doc = proc1.getResultDocument(rd1URI);

   proc2.transformToDocument(rd1Doc);
   var rd2URI = proc2.getResultDocuments()[0];
   var rd2Doc = proc2.getResultDocument(rd2URI);

   var proc3 = Saxon.run( {
                  stylesheet: "stage3.xsl",
                  source:      rd2Doc
               } );

}
</script>
</head>
<body>
<h1>Saxon-CE sample</h1>
<p>Pipelines</p>
<div id="main"></div>
</body>
</html>

Note that for the output from stage1 and stage2 I've exploited a
single xsl:result-document output rather than the principal output.
The output from the stage3 transform is directed to the HTML DOM.

API Issue: The result of transformToDocument() should be the principal
output document. Also, getResultDocument("") called on an
XSLT20Processor instance should return the principal output (for use
with asynchronous calls). However, there's currently an API bug (first
reported at: https://saxonica.plan.io/issues/1511 - but not resolved
as stated) that means that the 1st result-document is returned instead
in both cases.

----------

Phil Fearon