Return-Path: Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 37943 invoked from network); 13 Mar 2000 15:46:26 -0000 Received: from unknown (HELO aquarium.politel.com) (195.219.34.1) by locus.apache.org with SMTP; 13 Mar 2000 15:46:26 -0000 Message-ID: <266e7390e6976b2447d0c7d0a0aa0caa38cd0d51@> From: "Eric SCHAEFFER" To: , References: <0a9c6c687ffea977bd5a5a3a172ebeb538c8f228@> <00031015500000.01023@ricardo> Subject: Re: importing a org.w3c.dom.Document in another one Date: Mon, 13 Mar 2000 16:45:38 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N 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 To: 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() > ); >