For the following sample.xml file, how do I replace the value of arg key "Type A" and "Type B" separately using Python?
sample.xml:
<sample>
<Adapter type="abcdef">
<arg key="Type A" value="true" />
<arg key="Type B" value="true" />
</Adapter>
</sample>
This is how I approach to the arg attribute in Python:
tree = ET.parse('sample.xml')
for node in tree.iterfind('.//logging/Adapter[@type="abcdef"]'):
for child in node:
child.set('value', 'false') #This change both values to "false"