Aug-01-2018, 08:48 PM
Hi all,
I am looking for this help everywhere in the past days without success and I hope someone here can share some knowledge.
In the XML data below, how do I do for:
1 - Update the {id="012345"/res name="attrib1"/last_seem key} 'date' and 'status' attributes?
2 - Delete the {id="012345"/res name="attrib2}
3 - Add a new {id="123456"/res name="attrib2"} with 'first_seem' and 'last_seem' keys and values
Important:
- I am going to have hundred different users/IDs
- I am going to have dozens res/attributes
<stop>
<user id="012345">
<res name="attrib1">
<first_seem date="2018-07-31" status="REQUESTED">1</first_seem>
<last_seem date="2018-07-31" status="INPROCESS">0</last_seem>
</res>
<res name="attrib2">
<first_seem date="2018-07-31" status="REQUESTED">1</first_seem>
<last_seem date="2018-07-31" status="COMPLETED">0</last_seem>
</res>
</user>
<user id="123456">
<res name="attrib1">
<first_seem date="2018-07-31" status="REQUESTED">1</first_seem>
<last_seem date="2018-07-31" status="REQUESTED">0</last_seem>
</res>
</user>
</stop>
So far I found help to update values in a fixed path (i.e: /root/user/res/lastseem.text), what did not help me.
I tried to use the same command used to create the XML above changing a single/desired value, but instead of update, Python created a new entry
Thank you so much for any help.
I am looking for this help everywhere in the past days without success and I hope someone here can share some knowledge.
In the XML data below, how do I do for:
1 - Update the {id="012345"/res name="attrib1"/last_seem key} 'date' and 'status' attributes?
2 - Delete the {id="012345"/res name="attrib2}
3 - Add a new {id="123456"/res name="attrib2"} with 'first_seem' and 'last_seem' keys and values
Important:
- I am going to have hundred different users/IDs
- I am going to have dozens res/attributes
<stop>
<user id="012345">
<res name="attrib1">
<first_seem date="2018-07-31" status="REQUESTED">1</first_seem>
<last_seem date="2018-07-31" status="INPROCESS">0</last_seem>
</res>
<res name="attrib2">
<first_seem date="2018-07-31" status="REQUESTED">1</first_seem>
<last_seem date="2018-07-31" status="COMPLETED">0</last_seem>
</res>
</user>
<user id="123456">
<res name="attrib1">
<first_seem date="2018-07-31" status="REQUESTED">1</first_seem>
<last_seem date="2018-07-31" status="REQUESTED">0</last_seem>
</res>
</user>
</stop>
So far I found help to update values in a fixed path (i.e: /root/user/res/lastseem.text), what did not help me.
I tried to use the same command used to create the XML above changing a single/desired value, but instead of update, Python created a new entry

Thank you so much for any help.