How to use adoptNode()
TAUVEL Jeremie <[email protected]>
| Newsgroups | gmane.text.xml.batik.user |
|---|---|
| Message-ID | <0CF3DC3159572A4FB1A46CA2DB0751CF25A512F184@PRI-MBX-101.dom1.vinci-energies.net> |
Hello,
I would like to use org.apache.batik.dom.AbstractDocument::adoptNode() instead of importNode() to reduce cpu time and memory.
It works but in my program I dynamically update attributes in the DOM like color of stroke, rectangle... and if I use adoptNode() it doesn't work (with importNode() it is OK).
I have seen in the source that in adoptNode1() : attr.ownerElement is set to null to be conform with the Document Object Model (DOM) Level 3 Core Specification.
But in org.apache.batik.dom.AbstractAttr, my elements cannot be updated because it depends of ownerElement :
if(ownerElement != null) {
ownerElement.fireDOMAttrModifiedEvent(nodeName, this, s, val, MutationEvent.MODIFICATION);
}
So my questions are : is it possible to use adoptNode() in my case ?
Or maybe I miss something to have ownerElement initilized with the good Element after the adoptNode() ?
Thank you for your help.
Jeremie