W3C home > Mailing lists > Public > www-forms@w3.org > September 2001

REPOST: Evaluation Context of <bind> Computed Expression

From: Tomayko, Ryan <Ryan_Tomayko@stercomm.com>
Date: Tue, 18 Sep 2001 09:11:47 -0400
Message-ID: <5FD6397E455FD4118BAE000629383540014833D3@scidubmsg02.isg.stercomm.com>
To: "'www-forms@w3.org'" <www-forms@w3.org>
Since there was quite a bit of traffic on this list regarding the recent
terrorist attacks which took a considerable amount of attention from the
subject at hand, I wanted to repost this message as it seems to be a very
important problem with no proposed resolution. 

- Ryan

-----Original Message-----
From: Tomayko, Ryan 
Sent: Friday, September 14, 2001 9:15 AM
To: www-forms@w3.org
Subject: RE: Evaluation Context of <bind> Computed Expression

Thanks Mike,

> since relevant will be applied to every node in node-set 'ref' 
> *with that node as the context node.*

Okay, I completely missed this statement in the spec. I had the
understanding that the model-item properties were evaluated with the same
node context as the ref. If what you say is true, model item properties are
evaluated with the context node set to either the single node specified in
the ref or each node specified in the node-set.

I found the following in section 5.3.1:

> The bind element represents a node-set selected from the instance data. A 
> series of attributes on the element correspond to individual model item 
> properties, which are applied to each node in the node-set. 

Is there another piece of the spec I'm missing or can someone be more
specific with this paragraph? Does "applied to each node" mean that the
Computed Expressions are evaluated in the context of the selected ref or

If this is the case, it would make applying binding expressions possible
within a repeat. However, there is a problem with the solution you provided.
In the following, the *lineItem* element repeats, not the qty. The XPath
expression used in the ref attribute would return a node-set containing a
single node: the qty element of the *first* lineItem. It would not return
each qty child element of each lineItem. In other words, the XPath
expression you specified is equivalent 
to: po/lineItems/lineItem[1]/qty

<xform:bind id="qty"
     relevant="../total > 1000"/>

Sample instance data (I should have included this in my original message): 

So, it seems for the ref attribute, we're back at the beginning.. However,
if the ref attribute is specified on the ui control element instead of the
bind, this could be fully functional.

<xform:bind id="qty"
     relevant="../total > 1000"/>


<xform:repeat node-set="po/lineItems/lineItem">
	<xform:input ref="qty" bind="qty"/>

- Ryan

-----Original Message-----
From: Mikko Honkala [mailto:honkkis@tml.hut.fi]
Sent: Friday, September 14, 2001 5:39 AM
To: Tomayko, Ryan; www-forms@w3.org
Subject: RE: Evaluation Context of <bind> Computed Expression

Hi Tomayko,

I am not sure, whether this answers your questions at all, but I think the
bind should be written as:

<xform:bind id="qty"
     relevant="../total > 1000"/>

, since relevant will be applied to every node in nodeset 'ref' with that
node as the context node.

Therefore, I do not see why form controls that refer to instance items with
computed expressions, could not be used within 'repeat'.

- Mikko Honkala - http://www.x-smiles.org/
Received on Tuesday, 18 September 2001 09:12:42 UTC

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