We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c1c2f02 commit a4f4b6eCopy full SHA for a4f4b6e
1 file changed
libcomxml/core/__init__.py
@@ -235,7 +235,8 @@ def build_tree(self):
235
continue
236
self.doc_root.append(field.doc_root)
237
elif isinstance(field, list):
238
- # we just allow XmlFields and XmlModels in the list
+ # we just allow XmlFields and XmlModels
239
+ # Also xml as str for memory management
240
for item in field:
241
if isinstance(item, XmlField):
242
ele = item.element()
@@ -247,6 +248,9 @@ def build_tree(self):
247
248
if self.drop_empty and len(item.doc_root) == 0:
249
250
self.doc_root.append(item.doc_root)
251
+ elif isinstance(item, str):
252
+ ele = etree.fromstring(item)
253
+ self.doc_root.append(ele)
254
item = None
255
elif (field.parent or self.root.name) == self.root.name:
256
ele = field.element()
0 commit comments