[Bug 4313] [Update] applyUpdates should delete empty text nodes

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4313

           Summary: [Update] applyUpdates should delete empty text nodes
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Update Facility
        AssignedTo: andrew.eisenberg@us.ibm.com
        ReportedBy: chamberl@almaden.ibm.com
         QAContact: public-qt-comments@w3.org


In Update Section 3.2.2, upd:applyUpdates, Rule 3 specifies some
post-processing of text nodes after all the update primitives on the PUL have
beeen applied. Here is what it says:

"If, as a result of the above steps, the children property of some node
contains adjacent text nodes, these adjacent text nodes are merged into a
single node."

The reason for this rule is to avoid violating the Data Model constraint that
prohibits adjacent text nodes among the children of any node (Data Model
Section 6 Rule 2). BUT the above rules does not go far enough, because there is
another Data Model constraint that prohibits empty text nodes among the
children of any node (Data Model Section 6 Rule 3). Therefore, we need to add
one more processing step to upd:applyUpdates Rule 3: "If the children property
of some node contains an empty text node, that empty text node is removed from
the children property."

This change will make our update semantics consistent with the semantics of
element constructors (XQuery Section 3.7.1.3 Rule 3), which also merges
adjacent text nodes and deletes empty text nodes among the children of a
constructed element.

Regards,
--Don Chamberlin

Received on Friday, 9 February 2007 00:24:18 UTC