W3C home > Mailing lists > Public > www-forms@w3.org > May 2006

Actions changing the XPath context

From: Erik Bruchez <ebruchez@orbeon.com>
Date: Thu, 25 May 2006 22:37:40 +0200
Message-ID: <44761594.9010607@orbeon.com>
To: 'www-forms' <www-forms@w3.org>


Consider the following simple example:

<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
         <xforms:group ref=".[sort-by != 'capital']">
                 <xforms:action ev:event="DOMActivate">

When loading up this example, the button should appear. When you
activate it, the two xforms:setvalue actions will be run in order.

However, right after the first action has been executed, if you were
to evaluate the xforms:group single-node binding, it would now return
an empty node-set. This means that the context for the evaluation of
the second xfomrs:setvalue is now empty, and you will either get an
error or the action will do nothing. This may or may not achieve what
the form author initially intended (in this case, it didn't).

Note that the single-node binding expression ".[sort-by != 'capital']"
may be be considered unususal, but it is a very convenient way of of
hiding and showing controls and groups.

My questions are:

1. Is this meant to work? I not, I believe it should ;-)

2. Does XForms 1.0, explicitly or implicitly specify when the
    xforms:group's single-node binding is evaluated, i.e. is it allowed
    to re-evaluate it after the first xforms:setvalue?

3. What would happen if instead of using xforms:setvalue, I was to use
    xforms:delete in the action to delete the node to which an
    enclosing xforms:group is bound?

    <xforms:delete nodeset="sort-by" at="1"/>


Orbeon - XForms Everywhere:
Received on Thursday, 25 May 2006 20:38:05 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:17 UTC