1
我习惯于在Element
s上操作,而不是ElementTree
s。将ElementTree转换为元素
到目前为止,我可以从一个ElementTree
转换为Element
,使用:
tree = et.parse(xml_location)
et.fromstring(et.tostring(tree))
但这看起来昂贵的 - 是有从ElementTree
转换为Element
常规方法,除了上面?
非常好,谢谢。 – category