xsl-list
[Top] [All Lists]

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

2007-06-19 01:55:54
> * 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?

http://www.w3.org/TR/xproc/  (or http://xproc.org)

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'/>
        </antcall>
        
        <!-- 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'/>
        </antcall>
</target>

<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}"/>
        </antcall>
</target>

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.

[1] http://kernowforsaxon.sf.net/

cheers
andrew

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>