]> granicus.if.org Git - python/commitdiff
Fixed bug that disallowed processing instructions before and after
authorPaul Prescod <prescod@prescod.net>
Fri, 15 Sep 2000 17:09:19 +0000 (17:09 +0000)
committerPaul Prescod <prescod@prescod.net>
Fri, 15 Sep 2000 17:09:19 +0000 (17:09 +0000)
document element.

Lib/xml/dom/minidom.py

index 3f5668ed7787e093dc2dfaeaae2acdf78d7dc991..18d82eed6f1b67f30f22d7712b4a105b542f0f32 100644 (file)
@@ -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