elharo opened a new pull request, #126:
URL: https://github.com/apache/xerces-j/pull/126

   Fixes [XERCESJ-1597](https://issues.apache.org/jira/browse/XERCESJ-1597).
   
   When a `Document` was deep-cloned, the identifier map was copied but the 
corresponding attribute nodes were not marked as IDs, so `Attr.isId()` returned 
`false`. Removing such an attribute therefore did not remove its entry from the 
identifier map, and `Document.getElementById()` kept returning the element.
   
   This change follows the patch attached to the issue by Jacob Kjome. Instead 
of maintaining a reverse identifier map while cloning, `CoreDocumentImpl` now 
registers each cloned ID attribute with `Element.setIdAttributeNode()` and sets 
its type to `ID`. This both marks the attributes as IDs and keeps the new 
document's identifier map in sync.
   
   The new `dom.ids.Test#testCloneNodePreservesIdAttribute` fails before the 
change (the cloned attribute is not an ID) and passes after it, including 
removal of the attribute from the cloned document.
   
   `ant test` passes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to