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

keshlam@us.ibm.com writes:

> John Cowan asks:
> >Am I missing something?
> 
> No, you've accurately described what has to be done in order to deep-clone
> a 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"

There's more.  The problem is that some of the Node's might be instances of
some (possibly local) _subclass_ and may contain information which cannot be
correctly copied by any of the public createXXX methods.

> That's a significant amount of additional code which in Level 1 would exist
> _only_ to support Document.cloneNode(). It could be argued that, given
> Level 1's decision not to handle the more general uses of this logic,
> implementing it for this one specific case is less reasonable than
> declining to support cloning of Documents would be.

I think it would be a tragic mistake if it was not possible to copy a
document, or to copy a node from one document to another, using Level 1.
That's the kind of omission that would seriously impact the credibility of
the specification (not to mention its usefullness).

-- 
 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:38:49 UTC