Just to add to this: we've been working on fixing the namespace bugs in XML output. It's a little unfortunate that we use the HTML DOM for the intermediate results of the pipeline - the reason for this is primarily to make the results accessible to Javascript, which is not actually necessary for this use case; it would be much more efficient to use Saxon's internal tree structure for the intermediate results in the pipeline, and we may look at extending the API to allow this.

Michael Kay

On 20/02/2013 07:50, Myles Byrne wrote:
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
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 = Saxon.run( {
                  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: 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

Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:

saxon-help mailing list archived at http://saxon.markmail.org/