From: smbaker Date: Mon, 5 Dec 2011 05:00:56 +0000 (-0800) Subject: fix typeerror when calling xml.parse_dict X-Git-Tag: sfa-2.0-2~1^2~1 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=07132527206726486e5df8c2df5806de53647272 fix typeerror when calling xml.parse_dict --- diff --git a/sfa/util/xml.py b/sfa/util/xml.py index 1a7f2f37..90693f2e 100755 --- a/sfa/util/xml.py +++ b/sfa/util/xml.py @@ -195,7 +195,7 @@ class XML: self.namespaces['default'] = 'default' self.root = XmlElement(root, self.namespaces) - # set schema + # set schema for key in self.root.attrib.keys(): if key.endswith('schemaLocation'): # schema location should be at the end of the list @@ -208,7 +208,7 @@ class XML: if element is None: if self.root is None: self.parse_xml('<%s/>' % root_tag_name) - element = self.root + element = self.root.element if 'text' in d: text = d.pop('text') @@ -224,9 +224,9 @@ class XML: self.parse_dict(val, key, child_element) elif isinstance(val, basestring): child_element = etree.SubElement(element, key).text = val - + elif isinstance(value, int): - d[key] = unicode(d[key]) + d[key] = unicode(d[key]) elif value is None: d.pop(key)