[Twisted-Python] Re: [XML-SIG] Can anyone recommend a sensible XML parser for Python?

Uche Ogbuji uche.ogbuji at fourthought.com
Tue Sep 10 01:08:13 EDT 2002

> Uche Ogbuji writes:
>  > Wouldn't it be better for Python/XML to offer a *separate*, specialized 
>  > function for cloning nodes, rather than doing weird things with cloneNode?
> Why?  I'd rather make cloneNode() do the right thing, and it seems
> rather clear what that should be.  Certainly more clear than for
> DocumentType nodes.  ;-)

So you think it should do what I mentioned before?

1) Create a new documenType and document node
2) clone all child nodes
3) set the ownerDocument of each of the new nodes to the new document?

If we have it do that, then let us please

1) Document it properly
2) Point out that it is not standard DOM behavior

I am not at all clear that this is the "right thing".  I still think the right 
thing is to throw an exception.  I know the above behavior would throw me as I 
expect the ownerDocument of cloned nodes to be the same as the ones from which 
they were cloned.

But I certainly don't care enough about it to oppose such an addition.  I'd 
just like to make sure we call it out properly.  Least surprise and all that.

Uche Ogbuji                                    Fourthought, Inc.
http://uche.ogbuji.net    http://4Suite.org    http://fourthought.com
Track chair, XML/Web Services One Boston: http://www.xmlconference.com/
Basic XML and RDF techniques for knowledge management, Part 7 - 
Keeping pace with James Clark - http://www-106.ibm.com/developerworks/xml/libra
Python and XML development using 4Suite, Part 3: 4RDF - 

More information about the Twisted-Python mailing list