If a node is renamed, Userdata should be attached to a newly created node after
a newly created node has been inserted into the tree.
-------------------------------------------------------------------------------------------------------------------------------------
Key: XERCESJ-1444
URL: https://issues.apache.org/jira/browse/XERCESJ-1444
Project: Xerces2-J
Issue Type: Bug
Components: DOM (Level 3 Core)
Affects Versions: 2.9.1
Reporter: Ludger Bünger
Attachments: NodeRenameUserdataAttachOrder.txt
According to [1], the order how to process a renameNode if a new node is to be
created is (numbering added by me for better referencing):
"If simply changing the name of the given node is not possible, the following
operations are performed:
(1) a new node is created,
(2) any registered event listener is registered on the new node,
(3) any user data attached to the old node is removed from that node,
(4) the old node is removed from its parent if it has one,
(5) the children are moved to the new node,
(6) if the renamed node is an Element its attributes are moved to the new node,
(7) the new node is inserted at the position the old node used to have in its
parent's child nodes list if it has one,
(8) the user data that was attached to the old node is attached to the new
node."
Current Xerces2-J implementation first attaches the userdata to the new node
(step 8), then inserts the new node (7).
So according to the specs, this should by the other way around.
Attached please find a patch fixing this.
(The thing puzzling me is: the code was commited by Arnaud Le Hors himself
(commit 318496) who also wrote the specs (afaik).)
[1] http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-renameNode
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]