@@ -87,11 +87,11 @@ def toxml(self):
8787 return writer .getvalue ()
8888
8989 def toprettyxml (self , indent = "\t " , newl = "\n " ):
90- # indent = the indentation string to prepend, per level
91- # newl = the newline string to append
92- writer = _get_StringIO ()
93- self .writexml (writer , "" , indent , newl )
94- return writer .getvalue ()
90+ # indent = the indentation string to prepend, per level
91+ # newl = the newline string to append
92+ writer = _get_StringIO ()
93+ self .writexml (writer , "" , indent , newl )
94+ return writer .getvalue ()
9595
9696 def hasChildNodes (self ):
9797 if self .childNodes :
@@ -794,6 +794,7 @@ def createProcessingInstruction(self, target, data):
794794 def createAttribute (self , qName ):
795795 a = Attr (qName )
796796 a .ownerDocument = self
797+ a .value = ""
797798 return a
798799
799800 def createElementNS (self , namespaceURI , qualifiedName ):
@@ -806,6 +807,7 @@ def createAttributeNS(self, namespaceURI, qualifiedName):
806807 prefix , localName = _nssplit (qualifiedName )
807808 a = Attr (qualifiedName , namespaceURI , localName , prefix )
808809 a .ownerDocument = self
810+ a .value = ""
809811 return a
810812
811813 def getElementsByTagNameNS (self , namespaceURI , localName ):
0 commit comments