Re: Here's a tricky one

On 5/11/07, Norman Walsh <ndw@nwalsh.com> wrote:
> | Good point. If instead it was ffa7ffa7, then this would return an
> | empty node set, and you wouldn't get an error.
>
> Right. For maximum confusion :-)

Let's assume we use AVTs instead of a second 'select' attribute. Would
this at least partially alleviate the confusion? Instead of:

<p:option name="replace" select="concat('''', $p:episode, '''')"/>

And this is with XPath 2.0. With 1.0 I think you would need to write:

<p:option name="replace" select="concat('&apos;', $p:episode, '&apos;')/>

And this is if the 'apos' entity is declared. With AVTs you would write:

<p:option name="replace" value="'{$p:episode}'"/>

I think I like this better. I am not sure it alleviates the confusion
you raised earlier, but it is at least more readable and IMHO AVTs
convey better the sense that the expression is evaluated before the
value is passed to the component.

Alex
-- 
Orbeon Forms - Web 2.0 Forms for the Enterprise
http://www.orbeon.com/

Received on Friday, 11 May 2007 20:03:18 UTC