W3C home > Mailing lists > Public > public-forms@w3.org > October 2007

Re: 15 Insert/Delete Examples updated in Editor's draft

From: Erik Bruchez <ebruchez@orbeon.com>
Date: Fri, 12 Oct 2007 13:06:10 -0700
Message-ID: <470FD3B2.40908@orbeon.com>
To: "Forms WG (new)" <public-forms@w3.org>

John & all,

There is one example which doesn't work as I expect: B.4 Set
Attribute. I also don't understand the note "The context attribute is
not used because this pattern assumes the ability to indicate an exact
element to receive an attribute list, so nodeset is used."

I proposed a change to the text for insert was changed a while ago,
for consistency and simplicity reasons, as follows: when specifying a
nodeset, you always insert before or after a node in the
nodeset. Period. As simple as that. If a particular insertion doesn't
make sense, then we NOP (e.g. inserting an attribute before an
element).

However, it seems that this change did not make it to the to current
version of the spec, and I wonder why as I though that this change had
been agreed upon. Here is the reference, and I even wrote the spec
ready text for it, see:

   http://lists.w3.org/Archives/Member/w3c-forms/2007JanMar/0111.html
   http://lists.w3.org/Archives/Public/public-forms/2007Jul/0069.html

Read in particular the following rationale:

   "In the new text for 1.1, point 6b makes a distinction between two
    cases: either the cloned node is of the same type of the insert
    location node, or it is different. If it is of the same type, then
    the new node is inserted before or after, but if the type is
    different the node is inserted as a *child* of the insert location
    node.

    This sounds to me like an inconsistent behavior, and my guess is
    that this is informed by XForms 1.0's homogeneous collection
    heritage. But it also prevents certain use cases. For example, you
    may want to insert a text node or even a processing instruction
    node before or after an element. This is not possible because of
    the text in 2b [...]"

So now again, it seems we still this situation whereby the point of
insertion depends on the type of the cloned node, which makes spec,
implementation and writing more complex.

So IMO the right way of writing this example is:

   <xforms:insert context="item[2]" origin="item[1]/@rating"/>
   <xforms:insert context="item[3]" origin="item[1]/@rating"/>

The meaning of this is that you insert the attribute as a child of the
element.

-Erik

John Boyer wrote:
 >
 > The XForms 1.1 draft available from our home page now contains 15
 > example patterns for insert and delete actions.
 >
 > Please review
 > 
http://www.w3.org/MarkUp/Forms/specs/XForms1.1/index-diff.html#insert-delete-patterns 

 >
 >
 > Thanks,
 > 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
 >


-- 
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/
Received on Friday, 12 October 2007 20:06:17 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 October 2013 22:06:45 UTC