Re: [xsl] Dynamic pipelining in XSLT 2.0 w/ Saxon extensions

Subject: Re: [xsl] Dynamic pipelining in XSLT 2.0 w/ Saxon extensions
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Tue, 19 Jun 2007 09:55:39 +0100
> * Are there any obvious pitfalls or problems with this
> approach? (Or any not so obvious?) How does it compare to
> other methods?

I'm inclined to think that a general purpose pipeline processor will do the
job better. It's likely to have memory management that's better adapted to
this kind of work, and debugging facilities to examine the documents at any
stage of the pipeline or to switch validation of intermediate steps on and
off, etc. If you're lucky it might even allow distributed or asynchronous
execution of the pipeline.

Does XProc fit here? (or

As an aside,  if your architecture is batch transforming directories,
where multiple transforms are performed in sequence, then Kernow [1]
might be a good fit.  Now you can run it using Ant, you can set up
your processing pipeline quite simply:

<target name="pipe">
 <!-- first pass -->
	<antcall target="kernow-directory">
		<param name="input.filename" value="${input.dir}/one"/>
		<param name="xslt.filename" value="${xslt.dir}/one.xslt"/>
		<param name="output.filename" value="${temp.dir}/one"/>
		<param name="xslt.params" value='"a=1 b=2'/>
	<!-- second pass -->
	<antcall target="kernow-directory">
		<param name="input.filename" value="${temp.dir}/one"/>
		<param name="xslt.filename" value="${xslt.dir}/two.xslt"/>
		<param name="output.filename" value="${result.dir}"/>
		<param name="xslt.params" value='"a=1 b=2'/>

<target name="kernow-directory">
	<fail message="Property: 'input.filename' not set" unless="input.filename"/>
	<fail message="Property: 'xslt.filename' not set" unless="xslt.filename"/>
	<fail message="Property: 'output.filename' not set" unless="output.filename"/>
	<fail message="Property: 'xslt.params' not set" unless="xslt.params"/>
	<antcall target="kernow">
		<param name="java.classname" value="DirectoryTransform"/>
		<param name="arg1" value="${input.filename}"/>
		<param name="arg2" value="${xslt.filename}"/>
		<param name="arg3" value="${output.filename}"/>
		<param name="arg4" value="${xslt.params}"/>

You can set up fairly large processing pipelines, and because you're
using Ant it's straight forward to add steps like zipping up the
result and FTP'ing it to your severs, ready for when you walk in in
the morning :)

It does write out each stage of the processing but this is definitely
A Good Thing in my book - the obvious one is debugging but also
because the processing can be restarted from the stage at which it
failed - just by using a different Ant target.



Current Thread