Detecting unbound options

"Henry S. Thompson" <> 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=""
<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 <> | A man may by custom fortify himself            | 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