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>

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

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
Received on Saturday, 29 August 1998 20:52:27 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:04 UTC