From ce88db02303409ae8b19f8aaf5e540c2f99f47c1 Mon Sep 17 00:00:00 2001 From: Paul Prescod Date: Fri, 15 Sep 2000 17:09:19 +0000 Subject: [PATCH] Fixed bug that disallowed processing instructions before and after document element. --- Lib/xml/dom/minidom.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py index 3f5668ed77..18d82eed6f 100644 --- a/Lib/xml/dom/minidom.py +++ b/Lib/xml/dom/minidom.py @@ -396,10 +396,11 @@ class Document( Node ): self.nodeValue=None def appendChild( self, node ): - if node.nodeType==Node.ELEMENT_NODE and self.documentElement: - raise TypeError, "Two document elements disallowed" - else: - self.documentElement=node + if node.nodeType==Node.ELEMENT_NODE: + if self.documentElement: + raise TypeError, "Two document elements disallowed" + else: + self.documentElement=node Node.appendChild( self, node ) return node -- 2.40.0