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

Re: Should Document.cloneNode() work in Level 1?

From: Stephen R. Savitzky <steve@crc.ricoh.com>
Date: 09 Sep 1998 11:32:35 -0700
To: John Cowan <cowan@locke.ccil.org>
Cc: DOM List <www-dom@w3.org>
Message-ID: <qcr9xl87cs.fsf@gelion.crc.ricoh.com>
John Cowan <cowan@locke.ccil.org> writes:

> I don't really understand what the problem is.  Document.cloneNode
> with a shallow copy would just be another Document identical to this
> one but without children.  For a deep copy, do a shallow copy and
> then traverse the tree below this Document.  For each Node, invoke the
> proper createXXX factory method on the new Document and copy all the
> (IDL) attributes: then insert it into place in the new tree.
> 
> Am I missing something?

Yes.  The problem with the various createXXX factory methods is that they
may not copy all the information associated with a node (e.g. if the node is
really an instance of some locally-defined subclass with additional
attributes). 

-- 
 Stephen R. Savitzky   Chief Software Scientist, Ricoh Silicon Valley, Inc., 
<steve@rsv.ricoh.com>                            California Research Center
 voice: 650.496.5710   fax: 650.854.8740    URL: http://rsv.ricoh.com/~steve/
  home: <steve@starport.com> URL: http://www.starport.com/people/steve/
Received on Wednesday, 9 September 1998 14:26:49 GMT

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