I need to change the value of the parameters P_ModelName and P_ModelYear in the below xml code to some value which is in variable Var_modelname and Var_modelyear through python function.
Var_modelname = OEM_2020 Var_modelyear = 2020
please help me how to change these two parameter values in XML using python function
XML code before edit:
<PARAMETER xsi:type="parameterEntry">
<NAME xsi:type="unicode">P_ModelName</NAME>
<VALUE format-rev="1" xsi:type="valueBaseExpression">
<VALUE xsi:type="unicode">OEM_2019</VALUE>
</VALUE>
</PARAMETER>
<PARAMETER xsi:type="parameterEntry">
<NAME xsi:type="unicode">P_ModelYear</NAME>
<VALUE format-rev="1" xsi:type="valueBaseExpression">
<VALUE xsi:type="unicode">2019</VALUE>
</VALUE>
</PARAMETER>
The python function should edit the xml code as below with P_ModelName = OEM_2020 and P_ModelYear=2020
XML code after edit:
<PARAMETER xsi:type="parameterEntry">
<NAME xsi:type="unicode">P_ModelName</NAME>
<VALUE format-rev="1" xsi:type="valueBaseExpression">
<VALUE xsi:type="unicode">OEM_2020</VALUE>
</VALUE>
</PARAMETER>
<PARAMETER xsi:type="parameterEntry">
<NAME xsi:type="unicode">P_ModelYear</NAME>
<VALUE format-rev="1" xsi:type="valueBaseExpression">
<VALUE xsi:type="unicode">2020</VALUE>
</VALUE>
</PARAMETER>