将dicttoxml对象中的xml字符串插入lxml.etree

时间:2017-05-10 04:34:14

标签: python python-2.7

我有etree.Element基本上看起来像<Root></Root>

我想插入一堆来自children = dicttoxml(dict, root=False)的子元素。

后者给了我一些没有父母的元素,所以基本上做print children给了我这个:

<Child1></Child1>
<Child2></Child2>
<Child3></Child3>
<Child4></Child4>

我想将children插入我的根etree.Element,所以:

<Root>
   <Child1></Child1>
   <Child2></Child2>
   <Child3></Child3>
   <Child4></Child4>
</Root>

0 个答案:

没有答案