Hi Jeffrey,

I thought this would work, but both (parent) Documents seems to be
[#document:  null] if I do Document dom.toString(). And if I look in the
Xerces 1.0.2 code this check is made before replaceChild() can be done. Is
this a bug of the Xerces DomParser?

What to do?

Cheers,

Peet

New code:
    parsedDom.importNode(theRealElement, true);
    parsedDom.replaceChild(theElement, theElement);



----- Original Message -----
From: "Jeffrey Rodriguez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 15, 2000 12:47 PM
Subject: Re: replaceChild


> Mr. Sneekes, I think that the way to do this is by using
> the org.w3c.dom.Document public importNode method.
>
> Node         importNode(Node importedNode,
>                               boolean deep)
>                               throws DOMException;
>
> Thanks,
>           Jeffrey Rodriguez
>           XML4J Development
>           IBM Cupertino
>
>
>
>
> >From: "Peet Sneekes" <[EMAIL PROTECTED]>
> >Reply-To: "Peet Sneekes" <[EMAIL PROTECTED]>
> >To: "Xerces Mailgroup" <[EMAIL PROTECTED]>
> >Subject: replaceChild
> >Date: Wed, 15 Mar 2000 12:31:07 +0100
> >
> >Hi,
> >
> >I want to replace an Element of a Document with another Element from
> >another
> >Document.
> >So I first clone the new Element and than I do replaceChild() (see sample
> >code).
> >
> >Still it gives the "DOM005 Wrong document" error.
> >
> >Any suggestions? Thanks!
> >
> >Peet Sneekes,
> >Mediamatic IP,
> >Amsterdam
> ><< sampleCode.java >>
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>

Reply via email to