我有以下字典结构
[{
"Body" : [{
"Universal Lift Support" : ["1\"-9\" Extended Length",
"10\"-14.5\" Extended Length",
"15\"-19\" Extended Length",
"20\" + Extended Length"]
}]
我想使用该dicttoxml
库来获得所需的 xml 输出,例如:
<root>
<Body>
<Universal Lift Support>
1"-9" Extended Length
10"-14.5" Extended Length
15"-19" Extended Length
20" + Extended Length
</Universal Lift Support>
但是,在应用下一个代码后:
dicttoxml.dicttoxml(result, attr_type=False, root=True)
我得到了像这样的xml结构:
<?xml version="1.0" encoding="UTF-8" ?><root><item><Body><item><Universal_Lift_Support><item>1"-9" Extended Length</item><item>10"-14.5" Extended Length</item><item>15"-19" Extended Length</item><item>
哪些选项可以帮助格式化和获取如上所述的输出?