-----Original Message-----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Date: Wed, 6 Jun 2001 17:25:18 +0200
Subject: Problem with Document replication
> Hi,
>
> I have a problem with a certain operation : I'd like to create a new
> Document with a node {Element} extracted from another existing
> document
> .... here is the class :
> public Document Decomposer(Document docXML)
> {
> DocumentImpl XMLElementary = new DocumentImpl( );
> NodeList NL= docXML.getElementsByTagName("Word");
> Node node_ent = NL.item(0);
> Node node = node_ent.cloneNode(true);
> XMLElementary.importNode(node,true);
Try change the above line to:
XMLElementary.appendChild(XMLElementary.importNode(node,true));
I didn't test. Off my head, that's the correct way.
Good luck.
>
> System.out.println(XMLElementaire.hasChildNodes());
> <-------- this answers "false" .....
>
> return XMLElementary;
> }
>
> The problem is that my new Document "XMLElementary" is empty .... it
> haven't any ChildNodes ..... I don't understand why ??
>
> Thank you !!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
Zhaohua Meng
Hotlens.com Inc.
http://www.hotlens.com
350 Fifth AVE
Suite 3113
New York, NY 10118
Phone: 212-465-1700
Fax: 212-465-1710
email: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]