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 <>
Subject: Re: [saxon] Saxon-CE pipeline examples
To: Mailing list for the SAXON XSLT and XQuery processor
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>
<script type="text/javascript" language="javascript"
<script type="text/javascript" language="javascript">

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

   var rd1URI = proc1.getResultDocuments()[0];
   var rd1Doc = proc1.getResultDocument(rd1URI);

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

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

<h1>Saxon-CE sample</h1>
<div id="main"></div>

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: - but not resolved
as stated) that means that the 1st result-document is returned instead
in both cases.


Phil Fearon