[Zope-dev] XML Document appendChild questions

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


Martijn Faassen wrote:
> 
> This is possible, thought the provision (in the DOM spec):
> 
> 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.

Right. Since the DOM talks only of single documents (don't ask me why),
what they are doing is talking about a node in the document versus a node
floating in space.

> would imply that it is possible for a newChild to be added that is not
> already in the tree. But apparently it can't come from another tree, as
> that is cloning it, really?

I don't understand that sentence. It can't come from another document as
far as the DOM spec is concerned, but I don't have a problem with Zope
making the logical extension to multiple documents. You clone a node when
you want a copy that you can put somewhere else (in the same tree, in
standard DOM, in any tree, in an extended DOM).

> > The more important point is that a single element cannot have two parents.
> > You should clone it.
> 
> Yeah, but that isn't supported by XML Document yet. :) 

There's your real problem. :)

-- 
 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