Re: Document cloneNode

>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 UTC