aboutsummaryrefslogtreecommitdiffstats
path: root/gsxws/core.py
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2013-05-13 18:44:29 +0300
committerFilipp Lepalaan <f@230.to>2013-05-13 18:44:29 +0300
commit5f6da8bfcfd2ad8380815b6b5f309c9985873eb1 (patch)
tree66372fdce3cc2f7092c2ea7b11411a4f095fe97a /gsxws/core.py
parent59d7edde59e4bc3b4064a1fb3f36eb20393ff646 (diff)
downloadpy-gsxws-5f6da8bfcfd2ad8380815b6b5f309c9985873eb1.tar.gz
py-gsxws-5f6da8bfcfd2ad8380815b6b5f309c9985873eb1.tar.bz2
py-gsxws-5f6da8bfcfd2ad8380815b6b5f309c9985873eb1.zip
More to_xml nesting fixes!
Diffstat (limited to 'gsxws/core.py')
-rw-r--r--gsxws/core.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/gsxws/core.py b/gsxws/core.py
index 59f23dd..c8f9cec 100644
--- a/gsxws/core.py
+++ b/gsxws/core.py
@@ -336,15 +336,17 @@ class GsxObject(object):
"""
root = ET.Element(root)
for k, v in self._data.items():
- el = ET.SubElement(root, k)
- if isinstance(v, basestring):
- el.text = v
- if isinstance(v, GsxObject):
- el.append(v.to_xml(k))
if isinstance(v, list):
for e in v:
if isinstance(e, GsxObject):
- el.append(e.to_xml(k))
+ i = ET.SubElement(root, k)
+ i.extend(e.to_xml(k))
+ else:
+ el = ET.SubElement(root, k)
+ if isinstance(v, basestring):
+ el.text = v
+ if isinstance(v, GsxObject):
+ el.extend(v.to_xml(k))
return root