W3C home > Mailing lists > Public > www-forms@w3.org > February 2007

Re: implementors question: correct behavior of nested nodeset in repeat

From: John Boyer <boyerj@ca.ibm.com>
Date: Tue, 27 Feb 2007 17:22:37 -0800
To: David Landwehr <david.landwehr@picoforms.com>
Cc: Joern Turner <joern.turner@web.de>, mark.birbeck@x-port.net, www-forms@w3.org, www-forms-request@w3.org
Message-ID: <OF777A28A1.876FBB9D-ON88257290.0006C42A-88257290.0007910F@ca.ibm.com>
Although there is reasonably strong support for removing the notion of 
homogeneous collection in principle, I believe we did not resolve to do 
so.

I believe the sticking point was around the loss of the single common 
parent more than anything else, although continuity is useful too.

Although Joern made a good point about a problem that can occur with 
insertion if there is not a common parent to all the nodes, we have 
actually addressed this issue for insert (as Mark's response clearly 
shows).

But for the repeat itself, it becomes more difficult to *efficiently* 
detect whether the repeat needs to be updated.  One could, for example, 
create a listener on the single common parent to detect any addition or 
deletion of a child element and use that to know whether the nodeset for 
the repeat needs to be re-evaluated.  The nodeset may still be the same, 
in which case the repeat does not get updated, but having the single 
common parent as the focal point means that in a larger form I don't have 
to check every repeat nodeset whenever *any* node is inserted or deleted.

If we make this change, then the addition or deletion of a node *in any 
instance* would require the reevaluation of all nodesets of all repeats 
bound to that model.  It can be done, but it's slower.

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

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





David Landwehr <david.landwehr@picoforms.com> 
Sent by: www-forms-request@w3.org
02/27/2007 11:25 AM

To
John Boyer/CanWest/IBM@IBMCA
cc
mark.birbeck@x-port.net, Joern Turner <joern.turner@web.de>, 
www-forms@w3.org, www-forms-request@w3.org
Subject
Re: implementors question: correct behavior of nested nodeset in  repeat







Hi Joern,

I think all implementors in the working group have always returned 6 
nodes and not enforced the restriction of the homogeneous node-set; 
exactly as Mark Birbeck wrote. I think we once reached a consensus to 
remove this restriction in the group.

Best regards,
David



John Boyer skrev:
>
> Hi Joern,
>
> Hmm, yes, I forgot about that common parent issue entirely.
>
> Yes, XForms does currently place a restriction on what XPath will 
> natively do.
> So, the XPath will indeed produce 6 nodes, but XForms repeats place 
> restrictions on those nodes corresponding to the definition of 
> homogeneous collection.  So look for that word.
>
> The spec says that the nodes must have the same qname and same parent. 
>  This means that you can expect some or many implementations to create 
> a binding exception if the rules of homogeneous collection are not met.
>
> It turns out that the spec work has *not* been done to eliminate the 
> homogeneous collection language from repeat, though we did mostly 
> remove it from insert/delete in 1.1.
>
> My spidey sense tells me that a last call comment on this point may 
> not be too far in the distance.  Keep in mind that a 'last call' 
> comment doesn't mean it'll change, but it also doesn't mean it won't :-)
>
> Cheers,
> John M. Boyer, Ph.D.
> STSM: Workplace Forms Architect and Researcher
> Co-Chair, W3C Forms Working Group
> Workplace, Portal and Collaboration Software
> IBM Victoria Software Lab
> E-Mail: boyerj@ca.ibm.com  http://www.ibm.com/software/
>
> Blog: http://www.ibm.com/developerworks/blogs/page/JohnBoyer
>
>
>
>
> *"Mark Birbeck" <mark.birbeck@x-port.net>*
> Sent by: www-forms-request@w3.org
>
> 02/27/2007 08:29 AM
> Please respond to
> mark.birbeck@x-port.net
>
>
> 
> To
>                "Joern Turner" <joern.turner@web.de>
> cc
>                www-forms@w3.org
> Subject
>                Re: implementors question: correct behavior of nested 
nodeset in repeat
>
>
>
> 
>
>
>
>
>
>
> Hi Joern,
>
> There used to be a restriction on nodesets, such that they had to have
> a common parent and be all of the same name. This has since been
> relaxed, so in my view your example should have 6 nodes.
>
> (Even when the nodeset restrictions were tighter, I don't believe it
> was clear what to do in this situation; throw an error on selecting
> the nodes? Just return the first 3 nodes, from the first parent?
> Nothing was clearly defined.)
>
> Regards,
>
> Mark
>
>
> On 27/02/07, Joern Turner <joern.turner@web.de> wrote:
> >
> > seeking help understanding the following use case:
> >
> > for an instance like this:
> > xforms:instance id="Test" >
> > <data xmlns="">
> >   <level id="1">
> >    <item>Item 1-1</item>
> >    <item>Item 1-2</item>
> >    <item>Item 1-3</item>
> >   </level>
> >   <level id="2">
> >    <item>Item 2-1</item>
> >    <item>Item 2-2</item>
> >    <item>Item 2-3</item>
> >   </level>
> > </data>
> > </xforms:instance>
> >
> > and a repeat like this:
> > <xhtml:body>
> >   <xforms:repeat id="repeat1" nodeset="/data/level/item">
> >    <xforms:input ref=".">
> >     <xforms:label>Value</xforms:label>
> >    </xforms:input>
> >   </xforms:repeat>
> > </xhtml:body>
> >
> > what would be the correct behavior? Should the repeat show 3 or 6 
items
> > and what would happen in case of an insert?
> >
> > I couldn't find a clear answer to this from the Spec - help anyone?
> >
> > Joern
> >
> >
> >
>
>
> -- 
>  Mark Birbeck, formsPlayer
>
>  mark.birbeck@x-port.net | +44 (0) 20 7689 9232
>  http://www.formsPlayer.com | http://internet-apps.blogspot.com
>
>  standards. innovation.
>
>
Received on Wednesday, 28 February 2007 01:23:03 GMT

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