Let’s say I have an existing trivial XML file named ‘MyData.xml’ that contains the following:
<?xml version='1.0' encoding='utf-8' ?> <myElement>foo</myElement>
I want to change the text value of ‘foo’ to ‘bar’ resulting in the following:
<?xml version='1.0' encoding='utf-8' ?> <myElement>bar</myElement>
Once I am done, I want to save the changes.
What is the easiest and simplest way to accomplish all this?
Use Python’s minidom
Basically you will take the following steps:
The python spec should hold your hand rather nicely though this process.