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

Detecting unbound options

From: Norman Walsh <ndw@nwalsh.com>
Date: Tue, 26 May 2009 19:21:24 -0400
To: XProc Dev <xproc-dev@w3.org>
Message-ID: <m2tz374fij.fsf@nwalsh.com>
"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"
<p:output port="result"/>
<p:option name="path" required="true"/>
<p:option name="include-filter"/>
<p:option name="exclude-filter"/>

  <p:with-option name="path" select="$path">
  <p:with-option name="include-filter" select="$include-filter">
  <p:with-option name="exclude-filter" select="$exclude-filter">


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,

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 Tuesday, 26 May 2009 23:22:07 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:05 UTC