W3C home > Mailing lists > Public > www-dom@w3.org > July to September 1998

Re: cloneNode...

From: Don Park <donpark@quake.net>
Date: Sat, 29 Aug 1998 17:43:19 -0700
Message-ID: <002001bdd3af$31e9def0$2ee044c6@arcot-main>
To: "DOM List" <www-dom@w3.org>
ANOQ,

Congratz on your C++ DOM implementation.

>I was wondering about the cloneNode method in the 980818 spec.
>As I read it, it says that it clones all attributes of an
>ElementNode, and all children of all nodes if it's a deep
>clone. However it also says that any other nodes except
>Element does only create a copy of the Node type without
>any data.

Actually the sentence reads:

"Cloning any other type of node simply returns a copy of this node. "

There is nothing about "without any data."

>Does this mean that for instance the subclasses of
>CharacterData nodes does not get their text-contents
>cloned? And how about tagName in Element and similar
>data?

When Comment, CDATASection, and Text nodes are cloned, their text contents
are also copied for both deep and shallow cloneNode.  Element.tagName is
also cloned.

I hope this helps,

Don Park
Docuverse
Received on Saturday, 29 August 1998 20:52:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:45 GMT