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

Re: Detecting unbound options

From: mozer <xmlizer@gmail.com>
Date: Wed, 27 May 2009 07:40:21 +0200
Message-ID: <21d9ade60905262240he99451aibc0300773234e095@mail.gmail.com>
To: Norman Walsh <ndw@nwalsh.com>
Cc: XProc Dev <xproc-dev@w3.org>
Norm,

Are you suggesting that we eventually end up needing a construct to
test if a variable is bounded ?

Xmlizer

On Wed, May 27, 2009 at 1:21 AM, Norman Walsh <ndw@nwalsh.com> wrote:
> "Henry S. Thompson" <ht@inf.ed.ac.uk> writes:
>> So, if I want to detect and handle specially the case where an
>> optional option has not been specificed, how can I do so?
>
> You can't. And you know this bites harder than I realized.
>
> Consider the beginnings of a recursive directory listing step:
>
> <p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
>                xmlns:c="http://www.w3.org/ns/xproc-step"
>                xmlns:pxp="http://exproc.org/proposed/steps"
>                type="pxp:recursive-directory-list">
> <p:output port="result"/>
> <p:option name="path" required="true"/>
> <p:option name="include-filter"/>
> <p:option name="exclude-filter"/>
>
> <p:directory-list>
>  <p:with-option name="path" select="$path">
>    <p:empty/>
>  </p:with-option>
>  <p:with-option name="include-filter" select="$include-filter">
>    <p:empty/>
>  </p:with-option>
>  <p:with-option name="exclude-filter" select="$exclude-filter">
>    <p:empty/>
>  </p:with-option>
> </p:directory-list>
>
> </p:declare-step>
>
> Using four nested p:try/p:catch blocks to deal with the various permutations
> of $include-filter and $exclude-filter being defined or undefined seems
> pretty brutal.
>
>                                        Be seeing you,
>                                          norm
>
> --
> Norman Walsh <ndw@nwalsh.com> | A man may by custom fortify himself
> http://nwalsh.com/            | against pain, shame, and suchlike
>                              | accidents; but as to death, we can
>                              | experience it but once, and are all
>                              | apprentices when we come to it.--
>                              | Montaigne
>
Received on Wednesday, 27 May 2009 05:40:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 27 May 2009 05:41:00 GMT