cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric SCHAEFFER" <eschaef...@posterconseil.com>
Subject Re: importing a org.w3c.dom.Document in another one
Date Mon, 13 Mar 2000 15:45:38 GMT
Thank's, works great !

PS:

You meant
   myElement.appendChild(
       org.apache.cocoon.processor.xsp.XSPUtil.cloneNode(
         otherDocument.getDocumentElement(),
         myElement.getOwnerDocument()
        )
   );


_______________________________________

Eric SCHAEFFER
eschaeffer@posterconseil.com

POSTER CONSEIL
118 rue de Tocqueville
75017 PARIS
FRANCE
Tel. : 33-140541058
Fax : 33-140541059
_______________________________________

----------------------------------------------------------------------------
-----------------------------
 Come to the first official Apache Software Foundation Conference!
-----------------------------------
http://ApacheCon.Com ------------------------------------

----- Original Message -----
From: Ricardo Rocha <ricardo@apache.org>
To: <cocoon-dev@xml.apache.org>
Sent: Friday, March 10, 2000 9:46 PM
Subject: Re: importing a org.w3c.dom.Document in another one


> On Fri, 10 Mar 2000, Eric wrote:
> > I parse a file to create a DOM represention of its data (I don't use
Xerces
> > because it's not an XML file).
> > But if I create a Document instance, I can't insert it in another
Document
> > (I've got a wrong document error when I try to call the appendChild
method).
> > How can I do this ?
>
> Use
>   org.apache.cocoon.processor.xsp.XSPUtil.cloneNode(
>     Node node,
>    Document Factory
>   )
>
> This is a parser-independent utility that copies a node using
> a given document as "factory". Example:
>
>   myElement.appendChild(
>     otherDocument.getDocumentElement(),
>     myElement.getOwnerDocument()
>   );
>


Mime
View raw message