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

Re: Please consider bind hierarchies for the next draft

From: Jim Wissner <jim@jbrix.org>
Date: Thu, 13 Dec 2001 16:44:09 -0500
Message-Id: <>
To: "'www-forms@w3.org'" <www-forms@w3.org>

I strongly second this proposal.  It would be a great addition for all the 
reasons cited.


At 02:37 PM 12/13/2001 -0500, Tomayko, Ryan wrote:
>It would be nice if the bind elements could be used in a hierarchy. For 
>example, consider the following instance document and XForms constraints 
>per XForms specification:
>   <po xmlns="">
>     <orderInformation>
>       ...
>     </orderInformation>
>     <lineItems>
>        <lineItem>
>          <sku/>
>          <unitPrice/>
>          <quantity/>
>          <uom/>
>          <lineTotal/>
>        </lineItem>
>     </lineItems>
>   </po>
><xf:bind ref="po/lineItems/lineItem" maxOccurs="25" minOccurs="1"/>
><xf:bind ref="po/lineItems/lineItem/unitPrice"
>          relevant="not(../sku = '')"/>
><xf:bind ref="po/lineItems/lineItem/lineTotal"
>          calculate="../unitPrice * ../quantity"/>
>Now, consider the slightly revised bind elements below:
><xf:bind ref="po/lineItems/lineItem" maxOccurs="25" minOccurs="1">
>    <xf:bind ref="unitPrice" relevant="not(../sku = '')"/>
>    <xf:bind ref="lineTotal" calculate="../unitPrice * ../quantity"/>
>The result is a noticeable decrease in the length of ref expressions and, 
>IMO, more organized markup. This solves a couple of problems our 
>implementation is currently exposing:
>1. XForms developers complain of having to type extremely long paths over 
>and over. For instance, writing constraints for 5 or ten nodes that are 
>children of the following element can be quite tedious:
>(example taken from an xCBL Advance Ship Notice.)
>This also results in rather ugly markup.
>2. Obvious performance enhancements. Again, having to evaluate the long 
>path listed above 5 times as apposed to one.
>My suggestion is to modify the XForms schema to allow the <xforms:bind> 
>element to be a child of itself. When a bind element is being processed by 
>the XForms Processor, the context nodeset for XPath expressions is set to 
>the nodeset returned by evaluating the ref expression of that bind. The 
>nodeset returned is iterated over and each child bind's constraints are 
>evaluated in the context of the individual nodes of that nodeset (much in 
>the same way a repeat works for UI controls).
>This would greatly enhance the readability of bind elements and would also 
>serve as a fair performance enhancement. I am looking at a couple of early 
>XForms document attempts for rather large business documents and the 
>binding constraints get really messy when created in the current fashion.
>- Ryan
>Ryan Tomayko <<mailto:rtomayko@stercomm.com>rtomayko@stercomm.com>
>Sterling Commerce


Visit www.jbrix.org for:
   + SpeedJAVA jEdit Code Completion Plugin
   + Xybrix XML Application Framework
   + other great Open Source Software
Received on Thursday, 13 December 2001 16:40:24 UTC

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