Updating XML Elements and Attribute values python using Etree python



Hi I am having problem where I want to change element values inside XML tag but I am not able to find the suitable answer. In given XML file I want to modify the name of XML element "location_desc" and "process_id" to "loc.desc" and "proc.id" using python.Please suggest.



<MESSAGE
level="6"
parse="1"
parsedefvalue="1"
tableid="89"
id1="00926:02"
id2="stunnel"
eventcategory="1605000000"
summary=""
content="&lt;@:*SYSVAL($MSGID,$ID1)&gt;&lt;@msg:*PARMVAL($MSG)&gt;&lt;@event_description:VERIFY OK&gt; &lt;agent&gt;[&lt;process_id&gt;]: VERIFY OK: depth=&lt;fld1&gt;, &lt;location_desc&gt;"/>

No comments:

Post a Comment