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
Saxonica

On 20/02/2013 07:50, Myles Byrne wrote:
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


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help