Skip to content
Advertisement

Adding n after every element in an XML python

I’m making an automation that takes an existing XML file, changes one of the values and overwrites the file.

My main problem is that its important for me to keep the formatting of the original file and i can’t manage to do that, the new data has no line breaks and its all just a long line.

JavaScript

My code is:

JavaScript

How can i add an n after each element? Thanks!

Advertisement

Answer

As far as I understand, the below is what you are looking for.

JavaScript

out.xml below

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement