A follow up on this thread:

If you are iterating through a Document object while using my work-around
posted earlier in this thread then you may run into
java.util.ConcurrentModificationException exceptions due to my work-around
trying to modify the Document's userData table while some other iteration
is working with the same table.

Another, easier, work-around is to just do something like this:

Node importedNode =
adoptingNode.getOwnerDocument().importNode(nodeToImport, true);

>From then on use your importedNode object with the adoptingNode document.

The xerces Document objects will correctly call your UserDataHandler while
it clones the nodes in the importNode tree recursion, and you won't get
any ConcurrentModificationExceptions.

Note that this work-around has the downside of memory being gobbled by the
newly cloned node objects that are created by importNode().

-j


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to