Simple ElementTree Help

Heston James - Cold Beans heston.james at
Thu Oct 30 15:17:58 CET 2008

Hello Guys,


I have a small element tree task here whereby I need to crack open an XML
file, modify the text for one element and then resave it back again. I'm
currently trying to do this like follows:


# Parse the XML file.

application_settings = etree.parse('/configuration/application.xml')


# Modify the single_send_mode element.

application_settings.find("single_send_mode").text =


# Save the XML file.



This runs without error however it doesn't save the text into the
'single_send_mode' element and I end up with a configuration file which
contains <single_send_mode /> in it.


Can anyone offer any suggestions on how to get this to work properly?


Thanks guys, I appreciate it.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list