diff --git a/pisi/xmlext.py b/pisi/xmlext.py index c371d3ae..48070298 100644 --- a/pisi/xmlext.py +++ b/pisi/xmlext.py @@ -27,7 +27,8 @@ def getNodeText(node, tagpath = ""): except AttributeError: # no node by that name return None if child.nodeType == child.TEXT_NODE: - return child.data + # in any case, strip whitespaces... + return child.data.strip() else: raise XmlError("getNodeText: Expected text node, got something else!") diff --git a/pisi/xmlfile.py b/pisi/xmlfile.py index 8f159ca4..1945efc2 100644 --- a/pisi/xmlfile.py +++ b/pisi/xmlfile.py @@ -38,7 +38,8 @@ class XmlFile(object): def writexml(self, fileName): f = codecs.open(fileName,'w', "utf-8") - self.dom.writexml(f) + f.write(self.dom.toprettyxml()) + f.close() def verifyRootTag(self): if self.dom.documentElement.tagName != self.rootTag: