在Python中,如何使用元素树删除子节点?
我想删除特定节点的所有子节点。
原始xml文件:
<node class = "X" ...>
<node class = "y" ...>
<node class = "A" ...>
<node class = "z" ...>
<node class = "q" ...>
<node class = "y" ...>
</node>
并期待xml文件如下:
<node class = "X" ...>
<node class = "y" ...>
<node class = "A" ...>
<node class = "y" ...>
</node>
我需要删除具有attrib class =&#34; A&#34;
的特定Node的所有子节点