It seems that a problem appears when cloning an element containing
attributes. The element an attributes themselves are correctly cloned but
the resulting attributes return null when calling getOwnerElement, instead
of the new element.
This is due to the fact that the implementation of the cloneNode takes care
to mark cloned attributes as "not owned" since a newly cloned attribute has
nothing to do with the owner of its model. This is ok but while cloning an
element, one should take care to mark every attribute as "owned" back and
puting their owner to the new element.
This has to be done in org.apache.xerces.dom.ElementImpl.cloneNode(). I
would thus add there something like :
NamedNodeMap nodemap = getAttributes();
for (int i = 0; i < nodemap.getLength(); i++) {
NodeImpl attr = (NodeImpl)nodemap.item(i);
attr.isOwned(true);
attr.ownerNode = this;
}
Could one commiter take care of that ?
Thanks
Sebastien