Issue with test 10.3.j

All,

I believe that this test is incorrect. It contains three inserts
similar to this one:

<xforms:insert origin="instance('second')/item_list/item[1]/@price"
                nodeset="instance('first')/item_list/item[1]" />

The test expects that the attribute pointed to by the @origin
attribute is added to the element pointed to by the @nodeset
attribute. It is my understanding that this must not happen, and here
is why:

* The "insert location node" is element item[1] in instance
   "first".

* Then, "the insert location node provided by the Node Set Binding and
   optional at attribute is intended to be the sibling of the cloned
   node". This means that the attribute is intended to be a *sibling*
   of the item[1] element, which of course is not possible.

* Therefore we fall under the condition: "If a cloned node cannot be
   placed at the target location due to a node type conflict or because
   the target location is undefined, then the insertion for that
   particular cloned node is ignored."

This behavior was intentionally specified to consistently
differentiate between the insertion of siblings vs. children. Broadly:

* If one or more nodes result from @nodeset evaluation, then cloned
   nodes are inserted "next to" the nodes specified. (The root element
   is a border case exception.)

* Otherwise, if a node results from @context evaluation, then cloned
   nodes are inserted "within" the node specified.

So the test should be modified to:

<xforms:insert origin="instance('second')/item_list/item[1]/@price"
                context="instance('first')/item_list/item[1]" />

Alternatively, we could maybe keep test 10.3.j as is but make sure we
test that it NOPs, and create 10.3.k to test the proper insertion with
@context.

Note that example "B.4 Set Attribute" in the spec shows the correct
usage with @context.

Also, I believe that one implementation reported passing the broken
test.

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/

Received on Monday, 16 February 2009 18:48:15 UTC