W3C home > Mailing lists > Public > xproc-dev@w3.org > June 2009

RE: problem using with-option

From: <Toman_Vojtech@emc.com>
Date: Tue, 30 Jun 2009 09:15:25 -0400
Message-ID: <6E216CCE0679B5489A61125D0EFEC78710090AF9@CORPUSMX10A.corp.emc.com>
To: <xproc-dev@w3.org>
> 
> A newbie question, I'm afraid. Can anybody enlighten me as to 
> why this 
> works:
> 
> <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" name="test">
>   <p:directory-list path="/some/path"/>
> </p:declare-step>
> 
> and this doesn't:
> 
> <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" name="test">
>   <p:directory-list>
>     <p:with-option name="path" select="'/some/path'"/>
>   </p:directory-list>
> </p:declare-step>

The first pipeline uses the shortcut syntax for specifying options: the
value of 'path' is just a static string.
The second pipeline uses p:with-option which evaluates an XPath
expression. But for that, p:with-option needs a context over which to
evaluate the expression. You can solve this either by providing an
explicit empty context:

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" name="test">
  <p:directory-list>
    <p:with-option name="path" select="'/some/path'">
      <p:empty/>
    </p:with-option>
  </p:directory-list>
</p:declare-step>

If the pipeline had a primary input port, it would automatically become
the context of p:with-option. But because there is no such port, you
have to provide an explicit binding for p:with-option.

Regards,
Vojtech
Received on Tuesday, 30 June 2009 13:16:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 30 June 2009 13:16:26 GMT