From 07853c527bdf38fe7056870b3cf027b97f8ab44e Mon Sep 17 00:00:00 2001 From: "A. Murat Eren" Date: Thu, 21 Jul 2005 00:53:39 +0000 Subject: [PATCH] cici xml output.. --- pisi/xmlext.py | 3 ++- pisi/xmlfile.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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: