diff options
author | Filipp Lepalaan <f@230.to> | 2013-05-13 18:44:29 +0300 |
---|---|---|
committer | Filipp Lepalaan <f@230.to> | 2013-05-13 18:44:29 +0300 |
commit | 5f6da8bfcfd2ad8380815b6b5f309c9985873eb1 (patch) | |
tree | 66372fdce3cc2f7092c2ea7b11411a4f095fe97a /gsxws/core.py | |
parent | 59d7edde59e4bc3b4064a1fb3f36eb20393ff646 (diff) | |
download | py-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.py | 14 |
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 |