Im trying to implement a script python that update a specific value of the xml parameters. my issue that the parameter that I want to update appears multiple times respectively one row after the other. like this (the paramter called /DATA:
this is my xml file below which always starts with CATALOG And then CD and then DATA paramter:
<CATALOG>
<CD>
<DATA>1</DATA>
<DATA>2</DATA>
<DATA>3</DATA>
<DATA>6</DATA>
<DATA>7</DATA>
<DATA>9</DATA>
</CD>
</CATALOG>
Whenever I try by my script python to update that parameter I see all other parameters also changed to same value and I dont want the others paramters within the same name to be changed.
like each time I try to run my script python it changes all the data like this .. for instance I want to update first 4 rows of <DATA></DATA> as number 20 21 22 23 and others DATA parameters keep them with defaulted value which means it shall be as this:
<CATALOG>
<CD>
<DATA>20</DATA>
<DATA>21</DATA>
<DATA>22</DATA>
<DATA>23</DATA>
<DATA>7</DATA>
<DATA>9</DATA>
</CD>
</CATALOG>
but when I run my script python actually it changes all to number 20 and the output is like this:
<CATALOG>
<CD>
<DATA>20</DATA>
<DATA>20</DATA>
<DATA>20</DATA>
<DATA>20</DATA>
<DATA>20</DATA>
<DATA>20</DATA>
</CD>
</CATALOG>
Any help please how could I implement a function in python 2.7 to change the value of DATA parameter at each row of <DATA></DATA> in the xml file separately without affecting the other rows of DATA that has same parameter name?
much appreciated !
Note the xml file has default parameters that Im trying to modify by script python new values for the parameter DATA