W3C home > Mailing lists > Public > public-xformsusers@w3.org > September 2019

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

From: Erik Bruchez <erik@bruchez.org>
Date: Tue, 10 Sep 2019 23:12:26 -0700
Message-ID: <CAAc0PEWC2sHsc99fZ3-RCr4DFixA30ZuU-eYa20X+seFfy1uHQ@mail.gmail.com>
To: XForms <public-xformsusers@w3.org>

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:


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


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.

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:37:52 UTC