Re: <repeat/> Element

Hi Ivan,

You're suggesting that the repeat nodeset should be able to cover any set 
of nodes without further restrictions.  This is likely to happen for 1.1 
because it is a last call comment and because there is good support in the 
group to do so.  In fact, this is what we mean when we say we will "get 
rid of homogeneous collection" so I don't understand why you think there 
is a difference.

Moreover, although what you want will probably occur, it is hard to 
connect that occurrence to the rationale you provided. 

All of the nodes in a nodeset can indeed have a common parent node in the 
instance data.  XPath does not require that the nodes in the nodeset must 
be somehow owned by the nodeset and hence not still in the instance tree 
from which they were drawn, and I have never seen any technology that does 
this.  Indeed, XPath is internally driven by nodesets to drive each 
location step, so if nodes in a nodeset have no parents, then how could 
you process the ancestor axis on the next location step? 

Clearly, every node in the nodeset has a parent, and the XForms 1.0 spec 
places the further restriction on repeats that the nodeset over which it 
operates must contain nodes that have the same parent.  To check this is a 
trivial matter of post-processing the nodeset returned by XPath and 
producing an xforms-binding-exception if any node of instance data has a 
parent different from the one that is the parent of the first node.  But 
most implementations did not add the extra check.

Finally, by the same arguments, an XForms processor could indeed impose 
the restriction that the nodes in the nodeset must be contiguous elements. 
 The instance data is considered to be an XPath data model, and the 
nodeset identifies nodes in the instance data.  So, a simple 
post-processing step to XPath evaluation can determine, for each node, do 
the preceding and succeeding elements in the XPath data model appear in 
the nodeset or not?

For what it's worth, the sentence is missing a comma at the end of the 
parenthetic phrase "with the same local name and namespace name". However, 
it does not appear to me that this minor grammatic error gives rise to the 
issues you raised.

Cheers,
John M. Boyer, Ph.D.
STSM: Lotus Forms Architect and Researcher
Chair, W3C Forms Working Group
Workplace, Portal and Collaboration Software
IBM Victoria Software Lab
E-Mail: boyerj@ca.ibm.com 

Blog: http://www.ibm.com/developerworks/blogs/page/JohnBoyer





Ivan Latysh <IvanLatysh@yahoo.ca> 
Sent by: www-forms-request@w3.org
04/13/2007 06:05 PM
Please respond to
Ivan Latysh <IvanLatysh@yahoo.ca>


To
www-forms@w3.org
cc

Subject
<repeat/> Element







Hello All,

 I want to point into inconsistency in "9.3.1 The repeat Element" (
http://www.w3.org/TR/xforms11/#ui-repeat).

 [quote]
  1 This element defines a UI mapping over a homogeneous collection 
selected by Node Set Binding Attributes.
  2 This node-set must consist of contiguous child element nodes, with the 
same local name and namespace name of a common parent node.
  3 The behavior of element repeat with respect to non-homogeneous 
node-sets is undefined.
 [/quote]

 This definition contradict itself.
 
 Line 1 "collection selected by Node Set Binding Attributes", let see what 
does it mean:
 [quote from http://www.w3.org/TR/xforms11/#structure-attrs-nodeset]
  The following attributes define a binding between an XForms element such 
as a form control or an action and a node-set
  defined by the XPath expression.
 [/quote]
 Indeed, "collection selected by Node Set Binding Attributes" will return 
a node-set and according to XPath spec
 node-set is a collection of nodes without duplicates.
 (Since WG agreed that "homogeneous collection" is confusing and it will 
be removed I will skip it.)

 Line 2 completely contradict to line 1, node-set cold not have a common 
parent because it is a collection, as well it
 can not "consist of contiguous child element nodes"

 As the result <repeat/> element unable to work with node-sets even spec 
define that it should.

 My proposal is to reduce definition to a single sentence:
 [copy]
  1 This element defines a UI mapping over a node-set selected by Node Set 
Binding Attributes.
 [/copy]

 Such change will have absolutely no impact on existing forms and have 
minimal impact on implementations.
 
-- 
Best regards,
 Ivan                            mailto:IvanLatysh@yahoo.ca

Received on Tuesday, 17 April 2007 20:51:06 UTC