cici xml output..
This commit is contained in:
+2
-1
@@ -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!")
|
||||
|
||||
|
||||
+2
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user