Another thing for V.next: testing/defaulting for unbound options

I am often pulling option values off of bindings to HTTP requests.  As
such, there are times when options just do not have values.  As such,
when the pipeline runs, the option is unbound and so does not exist.

That means I can't write something like:

<p:with-param name="start" select="if (p:value-available('start'))
then $start else current-dateTime()"/>

and instead I have to restructure my xproc to check for the value and
ensure it has a value:

<p:choose>
   <p:when test="p:value-available('start')"> ... </p:when>
   ...
</p:choose>

Re-writing is certainly overkill.  It often means that I have to
create weird steps that use p:choose to output the value and then use
a select expression later on to get that value.

I'm not certain what the right solution here is in that an unbound
option causes the variable binding to not be in scope.  As such, you
get a syntax error in the expression.

Norm has suggested to me that we could default to binding options to
() (the empty sequence) in V.next.

-- 
--Alex Milowski
"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language
considered."

Bertrand Russell in a footnote of Principles of Mathematics

Received on Tuesday, 31 January 2012 17:00:17 UTC