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

Please consider bind hierarchies for the next draft

From: Tomayko, Ryan <Ryan_Tomayko@stercomm.com>
Date: Thu, 13 Dec 2001 14:37:30 -0500
Message-ID: <5FD6397E455FD4118BAE00062938354002C90217@scidubmsg02.isg.stercomm.com>
To: "'www-forms@w3.org'" <www-forms@w3.org>
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:
 
<xf:instance>
  <po xmlns="">
    <orderInformation>
      ...
    </orderInformation>
    <lineItems>
       <lineItem>
         <sku/>
         <unitPrice/>
         <quantity/>
         <uom/>
         <lineTotal/>
       </lineItem>
    </lineItems>
  </po>
</xf:instance>
 
<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"/>
</xf:bind>
 
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:
"xcbl:AdvanceShipmentNotice/xcbl:ASNHeader/xcbl:ASNOrderNumber/xcbl:ListOfMe
ssageId/xcbl:MessageID" 
(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.
 
Thanks,
- Ryan
 
  _____  

Ryan Tomayko < rtomayko@stercomm.com <mailto:rtomayko@stercomm.com> >
Sterling Commerce

  _____  

 
Received on Thursday, 13 December 2001 14:39:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:21:50 GMT