Remove xml node with lxml

admin,,,, admin

this is my xml file. when I clear () or the del method, it will clear the entire child, and an empty node creates

<user/>

How can I avoid creating this empty node

this will cause a problem when I use findall () and try to access any of its children

can anyone provide me a piece of code for a full node ???

+4
source share
1 answer

Delete matching the user node from the parent node will be appropriate for this case.

+4
source

Source: https://habr.com/ru/post/1300588/


All Articles