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

RE: Please consider bind hierarchies for the next draft

From: Micah Dubinko <MDubinko@cardiff.com>
Date: Thu, 13 Dec 2001 12:32:49 -0800
Message-ID: <E840F0B7E6189547BDB91DA8BF2228AB28C085@csmail.cardiff.com>
To: "'Tomayko, Ryan'" <Ryan_Tomayko@stercomm.com>, "'www-forms@w3.org'" <www-forms@w3.org>
This is a good proposal. We will consider it. -m

-----Original Message-----
From: Tomayko, Ryan [mailto:Ryan_Tomayko@stercomm.com]
Sent: Thursday, December 13, 2001 11:38 AM
To: 'www-forms@w3.org'
Subject: Please consider bind hierarchies for the next draft

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="">

<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 <rtomayko@stercomm.com>
Sterling Commerce
Received on Thursday, 13 December 2001 15:34:24 UTC

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