[XML-SIG] patch to core.py
Fred L. Drake
Fred L. Drake, Jr." <firstname.lastname@example.org
Mon, 23 Nov 1998 09:55:57 -0500 (EST)
I've attached a patch below that includes the last patch I sent
Friday evening (since it's not in yet; apply this to the CVS version),
and fixes the childNodes attribute of the Document object.
The Node.get_childNodes() method creates a NodeList which has
self.get_ownerDocument() as the owner. When used from the Document
class, the owner is None, but the owner for the chilren is self.
Without the fix, using nodes accessed from
<Document instance>.childNodes could easily cause
WrongDocumentException to be raised. This may not be a problem in a
typical application, where (I expect) the Document instance is mostly
used as node factory and source for Document.documentElement, but for
some particularly weird conversion scripts I'm working on where I'm
starting with multi-rooted documents, this can be a real problem.
Yes, I know XML only allows a single root; that's one reason a
conversion script is needed! ;-)
Fred L. Drake, Jr. <email@example.com>
Corporation for National Research Initiatives
1895 Preston White Dr. Reston, VA 20191