Re: xproc as an alternative to Apache ant

Sorry about the comment system James, I'll comment to them.


2009/5/24 James Sulak <jsulak@gmail.com>:
> From a cursory inspection, I see a few possibilities for importing
> sets of options in xproc.

I'm thinking of variables here, for use throughout the list of steps?
I.e. global name|value pairs. Are we talking about the same thing,
just using different names?



> Second, you can define a set of name/value pairs in an external XML
> document, and then use it to set variables:
>
> <p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
> xmlns:wxp="http://www.wordsinboxes.com/xproc"  name="pipeline">
>    <p:input port="source" primary="true" sequence="true">
>        <p:inline>
>            <root/>
>        </p:inline>
>    </p:input>
>    <p:input port="variables" sequence="true">
>        <p:inline>
>            <wxp:variable-set>
>                <wxp:variable name="new-name" value="hello"/>
>            </wxp:variable-set>
>        </p:inline>
>    </p:input>
>    <p:output port="result" primary="true" sequence="true"/>

Scope issue?
  Having defined $new-name in this step, is it available
within all the steps of the main xproc file?


>
>    <p:variable name="new-name"
> select="(//wxp:variable[@name='new-name']/@value, 'goodbye')[1]">
>        <p:pipe port="variables" step="pipeline"/>
>    </p:variable>
>
>    <p:rename match="/*">
>        <p:with-option name="new-name" select="$new-name"/>
>    </p:rename>
>
> </p:declare-step>
>
> Note that I've used a sequence to define a default value for
> $new-name. You could adapt the above to use a parameter input port if
> you wanted.

I'm unsure of your intent here James?
I hadn't got around to thinking about default values, simply
setting external values, a simple example being
the path to a stylesheet on the system which I'd then use
within a step.




>
> There might be a more elegant way to do it, but I don't see it at the
> moment.  Anybody want to give their 2 cents?  Would xi:including a
> bunch of p:options into the pipeline work?
>

That's an obvious one I'd missed :-)
Thanks James!

regards




-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

Received on Monday, 25 May 2009 05:04:50 UTC