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

Re: Accessing parameters

From: James Sulak <jsulak@gmail.com>
Date: Mon, 27 Sep 2010 17:36:12 -0500
Message-ID: <AANLkTimHMSvYTgdEo40UxaH=kJoGAvnR3MUHANWxHO4t@mail.gmail.com>
To: Florent Georges <fgeorges@fgeorges.org>
Cc: XProc Dev <xproc-dev@w3.org>
Hi Florent,

I believe this is what the p:parameters step is for.  Something like
this (untested and hastily written) should work:

   <p:input name="source"/>
   <p:input name="params" kind="parameter"/>

   <p:parameters>
     <p:input port="parameters" name="parameters">
        <p:pipe port="parameters" step="step_name" />
     </p:input>
    </p:parameters>

   <p:add-attribute match="elem" attribute-name="attr">
      <p:input port="source">
           <p:pipe port='source' step='step_name' />
      </p:input>
      <p:with-option name="attribute-value"
select="c:param-set/c:param[@name = 'P']/@value">
           <p:pipe port="result" step="parameters" />
      <p:with-option>
   </p:add-attribute>

where you substitute step_name is the name of the containing step.

See http://www.w3.org/TR/xproc/#c.parameters

Parameters are a bit of a strange animal. Other than p:xslt, I rarely use them.

-James



On Mon, Sep 27, 2010 at 5:02 PM, Florent Georges <fgeorges@fgeorges.org> wrote:
>  Hi,
>
>  I have a parameter port on my pipeline, which contains a
> parameter named P.  I'd like to add an attribute to an element by
> using p:add-attribute, and the value of the attribute must be the
> value of the param P.  Something like:
>
>    <p:input name="source"/>
>    <p:input name="params" kind="parameter"/>
>
>    <p:add-attribute match="elem" attribute-name="attr">
>       <p:with-option name="attribute-value" select="$params/P"/>
>    </p:add-attribute>
>
>  but it seems I missed a fundamental difference between accessing
> options and parameters.
>
>  Any idea?
>
>  Regards,
>
> --
> Florent Georges
> http://fgeorges.org/
>
>
Received on Monday, 27 September 2010 22:42:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 September 2010 22:42:35 GMT