cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Rocha <rica...@apache.org>
Subject Re: importing a org.w3c.dom.Document in another one
Date Fri, 10 Mar 2000 20:46:11 GMT
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