W3C home > Mailing lists > Public > xproc-dev@w3.org > October 2010

RE: Simplifying a series of simple p:xslt steps

From: Philip Fennell <Philip.Fennell@marklogic.com>
Date: Mon, 11 Oct 2010 23:53:26 -0700
To: Will McCutchen <mccutchen@gmail.com>, "xproc-dev@w3.org" <xproc-dev@w3.org>
Message-ID: <D20C296D14127D4EBD176AD949D8A75A44262A36@EXCHG-BE.marklogic.com>

If you are desperate to simplify this then you can declare your own pipeline step that encapsulates the p:xslt step. If all it is that changes is the URL of the XSLT document then make that the single option in your step. The down side to this is that because you cannot parameterise the href attribute on the p:document instruction you will need to use a p:load in your step in order to bring the referenced transform into the pipeline. You'd end up with a sequence of one line steps in you pipeline plus a reference to the library module that your step declaration exists in. That'd 'simplify' the appearance of the pipeline but obfuscate what's going.


Philip Fennell

MarkLogic Corporation
Mobile +44 (0) 7824 830 866

email  Philip.Fennell@marklogic.com
web    www.marklogic.com

This e-mail and any accompanying attachments are confidential. The information is intended solely for the use of the individual to whom it is addressed. Any review, disclosure, copying, distribution, or use of this e-mail communication by others is strictly prohibited. If you are not the intended recipient, please notify us immediately by returning this message to the sender and delete all copies. Thank you for your cooperation.

From: xproc-dev-request@w3.org [xproc-dev-request@w3.org] On Behalf Of Will McCutchen [mccutchen@gmail.com]
Sent: 11 October 2010 21:42
To: xproc-dev@w3.org
Subject: Simplifying a series of simple p:xslt steps

I've got a simple XProc pipeline that simply applies a predetermined
series of XSLT transformations to its input document.  I'm
investigating the replacement of a Python driver script with this
XProc pipeline and Calabash.  The pipeline as I've written it
accomplishes its task, but does so in what feels to me like an
extremely verbose/redundant/repetitive way.

I'm hoping that there is an easy way to reduce some of the repetition.
 I just don't see how to do it, so far.

Here's the pipeline in question (with a number of the steps elided,
for simplicity's sake):

<?xml version="1.0"?>
<p:pipeline version="1.0" xmlns:p="http://www.w3.org/ns/xproc">
   <p:xslt name="remove-locations">
       <p:input port="stylesheet">
           <p:document href="preprocessors/remove-locations.xsl"/>

   <p:xslt name="divisions-1">
       <p:input port="stylesheet">
           <p:document href="preprocessors/divisions-1.xsl"/>

   <!-- ... plus six or seven more identical (save for name and stylesheet)
   p:xslt steps ... -->

   <p:xslt name="consolidate-descriptions">
       <p:input port="stylesheet">
           <p:document href="preprocessors/consolidate-descriptions.xsl"/>

As you can see, all of my <p:xslt> steps (if that's the right word)
follow the same pattern.  Is there anything I can do to simplify this
pipeline while staying within "plain" XProc?

I suppose, also, that XProc might simply be overkill for my use case.
If that is so, do you have any suggestions for alternatives?


Will McCutchen
Received on Tuesday, 12 October 2010 06:54:15 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:07 UTC