About binds and variables and the processing model

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:43 UTC