Re: Document cloneNode

Tom,

>The method cloneNode utilizes three protected methods: shallowClone, to do
>the immediate cloning stuff; an overload of cloneNode that accepts an owner
>parameter; and a cloneChildren method that clones the children as well as
>sets their owners.


cloneNode(Document owner, boolean deep) scheme should work as well.  I just
chose the double tree walk scheme because a) double tree walk is costs is
insignificant when there is a large number of object instantiation going on,
b) cloneNode is likely to be overriden by user's own subclasses so I did not
want my users to have to deal with extra details of owner document switching
while cloning, and c) I prefer not to introduce unnecessary methods when
dealing with design 'glitch' like this.

Best,

Don Park
Docuverse

Received on Thursday, 8 October 1998 19:38:22 UTC