[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Error when cloning DOM nodes
Falko Braeutigam wrote:
> Hmmm... the problem now is that ElementImpl.cloneInto() calls super.cloneInto()
> which calls setNodeValue(), which is not allowed for Elements. I checked in a
> work around but I'm by no means a XML expert and someone has to look into this.
The following code seems to work (in NodeImpl.cloneInto):
String nodeValue = getNodeValue();
if (nodeValue != null)
into.setNodeValue(nodeValue);
So the hack can be removed:
try {
into.setNodeValue( _nodeValue );
}
catch (DOMExceptionImpl e) {
if (e.code != DOMException.NO_DATA_ALLOWED_ERR) {
throw e;
}
}
Michael Keuchen