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

Re: Document cloneNode

From: <keshlam@us.ibm.com>
Date: Thu, 8 Oct 1998 21:53:01 -0400
To: www-dom@w3.org
Message-ID: <85256698.0009A016.00@us.ibm.com>
As I said, it's not hard to do. I just begrudge adding code to multiple
classes in my implementation of the DOM in order to support _only_ the
Document.cloneNode operation; it offends my sense of proportion. <grin>

The other approach, of course, is to try to guess where DOM Level 2 is
going to go in terms of allowing data to be copied from document to
document. Past conversation has generally guessed that this would be done
by providing a "content clone" -- essentially, a copy constructor -- which
uses the DOM's public API to extract data from the source and use it to
create corresponding nodes native to this implementation (and anchored in
this Document). Implementing Document.cloneNode based on that, rather than
doing a special-case clone-and-reparent, is a larger chunk of code and
won't run as fast... but on the other hand it's a more general solution,
and represents functionality that the DOM is probably going to acquire
anyway at some point.

Joe Kesselman  / IBM Research
Unless stated otherwise, all opinions are solely those of the author.
Received on Thursday, 8 October 1998 21:46:17 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:04 UTC