[Zope-dev] XML Document appendChild questions

Paul Prescod paul@prescod.net
Tue, 27 Jul 1999 12:38:28 -0700


Martijn Faassen wrote:
> 
> def appendChild(self, newChild):
>         """
>         Adds the node newChild to the end of the list of children of
> this node.
>         If the newChild is already in the tree, it is first removed.
>         """
> 
> But in this case 'newChild' is in *another* tree and it is removed as
> well. Is this intentionally? 

I don't think that the standard DOM API even has a provision for moving
nodes from one document to another.

The more important point is that a single element cannot have two parents.
You should clone it.

-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for only himself
 http://itrc.uwaterloo.ca/~papresco

To me programming is more than an important practical art. It is
also a gigantic undertaking in the foundations of knowledge.
	- Grace Hopper