Re: problem using with-option

Hi Kevin,

This is definitely an XProc gotcha.  The problem is that p:with-option
needs to evaluate the xpath in its @select attribute against a
context, and since it has no default readable input port, there is
none.  This is true even though you're providing a string constant.
So, if you explicitly provide it with a context, even an empty one, it
will work:

<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>

Hope this helps,

-James


On Tue, Jun 30, 2009 at 6:52 AM, Kevin Flynn<kevin@escenic.com> wrote:
> 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>
>
> I'm using Calabash 0.9.10. The error returned is:
>
> Error  : file:/home/kevin/xproc-test/import-tldinfo.xpl:3: option path
> unbound on p:directory-list step named #ANON.85 and no default readable
> port.
> Error  : Pipeline failed: err:XS0032: option path unbound on
> p:directory-list step named #ANON.85 and no default readable port.  It is a
> static error if no binding is provided and the default readable port is
> undefined.
>
>
> Kevin Flynn
>
>
>

Received on Tuesday, 30 June 2009 13:11:39 UTC