I try to do this thing here :
BEFORE
<a>
<b>
<c>
<d>
<name>VERSION</name>
<description />
<defaultValue>v1.0.0</defaultValue>
<trim>false</trim>
</d>
<d>
<name>LINK</name>
<description />
<defaultValue>current</defaultValue>
<trim>false</trim>
</d>
</c>
<b>
</a>
AFTER
<a>
<b>
<c>
<d>
<name>VERSION</name>
<description />
<defaultValue>v2.0.0</defaultValue>
<trim>false</trim>
</d>
<d>
<name>LINK</name>
<description />
<defaultValue>I changed the link</defaultValue>
<trim>false</trim>
</d>
</c>
<b>
</a>
I have an XML file and I want to change the default values. I tried with this code but didn't work and idk how to handle it :
from xml.etree import ElementTree as ET
tab = ["V2.0.0, "I changed the link"]
i = 0
tree = ET.parse("myfile.xml")
for child in tree.findall(".//d"):
tree.find(".//defaultValue").text = tab[i]
i=+1
Thank you for your help !