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

RE: Parameter value from an input port

From: Bruce Chapman <bruce.chapman@nec.co.nz>
Date: Thu, 09 Sep 2010 12:04:55 +1200
To: 'Florent Georges' <fgeorges@fgeorges.org>, 'XProc Dev' <xproc-dev@w3.org>
Message-id: <63AD1F1F8285450CB08711761B2C1AE9@necwlgxpwapp210>
Florent,

I think you are supposed to supply the context for the xpath expression as a
document binding (if that's the correct terminology) in a child element of
the <p:with-param> like this

<p:with-param name="p" select="/doc/foo">
    <p:pipe step="the-name-of-your-unnamed-declare-step" port="input" />
</p:pipe>


Bruce

-----Original Message-----
From: xproc-dev-request@w3.org [mailto:xproc-dev-request@w3.org] On Behalf
Of Florent Georges
Sent: Thursday, 9 September 2010 11:32 a.m.
To: XProc Dev
Subject: Parameter value from an input port

  Hi,

  I am struggling with a simple problem, related to passing a
parameter to a step.  Let's assume I have the following step
declaration:

    <p:declare-step type="my:step">
       <p:input port="input"/>
       <my:other>
          <p:input port="source">
             ...
          </p:input>
          <p:with-param name="p" select="..."/>
       </my:other>
    </p:declare-step>

  The step has an input port, and calls another step, setting its
source port, and passing the parameter p.  The value of p must be
the value of a sub-element of the input port.  Let's say the
input port is bound to a document like:

    <doc>
       <foo>abc</foo>
       <bar>xyz</bar>
    </doc>

and I want to pass the value of doc/foo as the value of the
parameter p (in pseudo notation, if the port was bound to a
variable, something like select="$input/doc/foo").

  I am sure this is a simple problem, and yet I cannot find an
answer.  Any idea?

  Regards,

-- 
Florent Georges
http://fgeorges.org/
Received on Thursday, 9 September 2010 00:06:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 9 September 2010 00:06:03 GMT