Help regarding XML file manipulation

Salil GK salilgk at gmail.com
Tue May 25 04:54:20 EDT 2010


Hello

  I need to make a quick prototype to process some xml file. I found
xml.dom.minidom much handy and I can get information from the xml file. But
I need to update a filed in the xml file and save the file. I couldn't find
a way to do that. Could some one please help me on this.

Basically this is what I want to do

<?xml version="1.0" encoding="UTF-8"?>
<TopLevel>
 <Level2>
  <Engineer>Hari</Engineer>
  <DOJ>102010</DOJ>
  <NextLeave>201010</NextLeave>

  <Engineer>Rama</Engineer>
  <DOJ>102010</DOJ>
  <NextLeave>201010</NextLeave>

 </Level2>
</TopLevel>

Here I want to read the Engineer information and then change the NextLeave
information to a new value and save to the same file. How do we do this -
can some one please help me with some sample code for the same.

Thanks
~S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100525/1b621f57/attachment.html>


More information about the Python-list mailing list