W3C home > Mailing lists > Public > public-forms@w3.org > March 2008

About binds and variables and the processing model

From: Erik Bruchez <ebruchez@orbeon.com>
Date: Wed, 26 Mar 2008 17:21:50 -0700
Message-Id: <C5DBA8D7-1049-4706-809D-C704CC77237B@orbeon.com>
To: public-xforms@w3.org

All,

I think that we had a good conversation this morning about the design
of the simplified syntax. Following-up on this, we had a little
brainstorming here at work about the question of variables in binds.

Consider this example:

<xforms:bind nodeset=".">
     <xforms:bind id="subtotal" nodeset="subtotal"  
calculate="sum($lineTotal)"/>
     <xforms:bind nodeset="row">
         <xforms:bind id="lineTotal" nodeset="lineTotal"  
calculate="$unitCost * $qty"/>
         <xforms:bind id="unitCost" nodeset="unitCost"/>
         <xforms:bind id="qty" nodeset="qty"/>
     </xforms:bind>
</xforms:bind>

This is clearly a case in line with what we were talking about this
morning where one bind refers, by variable, to a bind declared by id
further down.

I have intentionally reverted the order of all references to make the
problem all the more visible.

But it seems to me that if, for a start, we do not allow using
variables within xforms:bind/@nodeset attibute, the only constraint is
that when evaluating attributes such as @calculate, etc., the bind
nodesets have already been evaluated.

So you could just do a first pass evaluating the bind nodesets. This
allows you to declare all the variables which are in scope. Then you
are back to the current case of the dependency algorithm. Sounds very
easy to me.

Or am I missing something?

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/
Received on Thursday, 27 March 2008 00:27:51 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 October 2013 22:06:47 UTC