Fixed bug that disallowed processing instructions before and after
document element.
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py
index 3f5668e..18d82ee 100644
--- a/Lib/xml/dom/minidom.py
+++ b/Lib/xml/dom/minidom.py
@@ -396,10 +396,11 @@
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