Commit ce88db02 authored by Paul Prescod's avatar Paul Prescod

Fixed bug that disallowed processing instructions before and after

document element.
parent 89990533
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment