ACTION-2261 - Clarify what to do with merged text noes in xforms-replace event

All,

The issue is the following: the replace action can replace an
existing node, in particular an element or a comment node, with a text
node. Text node normalization must happen after that. So if you had:

    <data>a<foo/>c</data>

and you replace the element with text "b", you get:

    <data>abc</data>

The result only has *one* text node containing "abc".

Something similar can happen with the insert action (and with the delete
action as well, but that action doesn't have an event context information
with this problem).

Now, in this case, what should the `inserted-nodes` context info of
`xforms-replace` or `xforms-insert` contain? I see 3 possibilities:

1. Point to nodes that might have been created and then merged. Those won't
be referenced from the XPath data model anymore. With the example above,
the text node would contain "b". This doesn't seem very useful and would
constrain the implementation to create that temporary text node before
merging it.

2. Point to the merged node. Here, it would be the "abc" text node. Then
the description "inserted nodes" would be misleading. It's a new text node
or modified text node, but not really something that got inserted.

3. Not include the node at all in `inserted-nodes`, and consider adding
instead an `inserted-items` context information.

To discuss.

-Erik

Received on Wednesday, 11 September 2019 06:13:01 UTC