Re: Detecting unbound options


On Wed, May 27, 2009 at 4:06 PM, Norman Walsh <> wrote:
> "Henry S. Thompson" <> writes:
>>> Yuck! But can we really live with this...
>> For sure not.
>> The most straightforward approach would be to add p:bound? as an XPath
>> extension function.
> Alas, I think that would just trade a great big nested p:try/p:catch
> for a great big p:choose...

A small win, but a win !

Let's try to solve your use case

Here are the ways to solve it with the lesser code
1) First, is to say that selecting an unbound variable will generate
un unbound variable (a bit tricky)
2) To add an attribute on p:with-option that says
@bound-like-this-option="$foo" ; if foo is bound then the variable
will be bound and the value will be the content of the select and will
not be bound if $foo isn't bound

In this case you just have to write

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

We eventually need to come up with a better name for this attribute


Received on Wednesday, 27 May 2009 16:50:07 UTC