[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Error when cloning DOM nodes
On Fri, 10 Nov 2000, Michael Keuchen wrote:
> 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;
> }
> }
It's in CVS. Thanks.
Falko
--
______________________________________________________________________
Falko Braeutigam mailto:falko@smb-tec.com
SMB GmbH http://www.smb-tec.com