469,929 Members | 1,413 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,929 developers. It's quick & easy.

Read, modify & save xml file

Hi,

Using Python, I want to read xml file from the disk, modify the values/add elements/attributes and save the xml back to disk.

Please give me the sample source code for the same.

Thanks,
Jun 9 '08 #1
2 6511
You can make use of the the xml.dom or xml.dom.minidom to parse the xml files. If not successful try simple search and replace methods using file objects
Jun 10 '08 #2
Laharl
849 Expert 512MB
Use minidom rather than dom, it's much more lightweight.
Jun 10 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Graham Taylor | last post: by
8 posts views Thread by Arvind P Rangan | last post: by
reply views Thread by Patrick De Ridder | last post: by
14 posts views Thread by Arne | last post: by
2 posts views Thread by =?Utf-8?B?YW5rMmdv?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.