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

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 UTC