I am writing raw data to a python program for xml files, in my project we get the raw data line by line, then write it to an xml file, for example:
`<root>\n
<a> value </a>\n
<b> value </b>\n
</root>
The first time I write to the xml file with pretty_print = True, I got what I want, but when the second time I read the file, I get the root of the element, --add-- new elements, and then save it with pretty_print = True, but I canβt get what I want, itβs just like:
...\n
<c> value </c></root>
`what's wrong with lxml? Or is it my fault?
source
share