Fixed bug that disallowed processing instructions before and after

document element.
This commit is contained in:
Paul Prescod 2000-09-15 17:09:19 +00:00
parent 8999053326
commit ce88db0230

View 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