lxml etree add new nodes to existing xml, the new node has no typesetting format

When the newly added if not treated, it is like this

 

To add xml parsing

= etree.XMLParser Parser (remove_blank_text = True) 
xml = etree.parse (majorXMLPath, Parser)
in order in the back
pretty_print = True entry into force of 

solutions to the https://blog.csdn.net/xcookies/article/details/78647242

 

Guess you like

Origin www.cnblogs.com/tangmiao/p/10980453.html