This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Appending a Document to another


Hi,

I tried

Node ndResults=xmlDocA.getFirstChild();
..
xmlDocB = parser.getDocument();
ndResults.appendChild(xmlAddOn.getDocumentElement());

but then i get: 

org.apache.xerces.dom.DOMExceptionImpl: WRONG_DOCUMENT_ERR

/anders

-----Original Message-----
From: owner-xsl-list@mulberrytech.com
[mailto:owner-xsl-list@mulberrytech.com]On Behalf Of Bernhard Keil
Sent: Monday, February 07, 2000 10:49 AM
To: 'xsl-list@mulberrytech.com'
Subject: RE: Appending a Document to another


you can insert add root of doc B 
as child of the root of doc A.

-----Original Message-----
From: Anders K [mailto:cyberspock@telia.com]
Sent: Montag, 7. Februar 2000 10:30
To: 'Xsl-List (E-mail)
Subject: Appending a Document to another


Hi,

I wonder if there is anybody who can tell
me a simple way to add one or more XML-docs
to another Document ?

i.e. 


Document A = new DocumentImpl();
... filling A up with stuff ...

// now I need to add some docs.
DOMParser dp = new DOMParser();
db.parse(somefile);
Document B = db.getDocument();

i tried
fc = A.getfirstchild();
fc.appendChild(B);
but got an exception wrong doc

or do I have to traverse the 
Document B adding the nodes
one by one? (which seems to be so much fun ;-)

TIA
</anders>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]