W3C home > Mailing lists > Public > www-dom@w3.org > October to December 1998

Re: Document cloneNode

From: Don Park <donpark@quake.net>
Date: Thu, 8 Oct 1998 08:23:34 -0700
Message-ID: <003501bdf2cf$a0c63be0$2ee044c6@arcot-main>
To: <www-dom@w3.org>
>When cloneNode is called for a Document object, what should docType and
>documentElement refer to if the clone is not deep?  My inclination is to
set
>each to NULL on a shallow clone, and clones of their respective objects in
a
>deep clone.


I believe your interpretation is correct.  Shallow cloneNode clones the
target node and its attributes but not the child nodes.  Since docType and
documentElement are both possible child nodes of Document, I don't think
they should be cloned.

Best,

Don Park
Docuverse
Received on Thursday, 8 October 1998 11:24:02 GMT

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