Xml which need to be parsed "cos1.XML"
<config xmlns="http://tail-f.com/ns/config/1.0">
<sys xmlns="urn:XYZ:ns:yang:app:4.3.3.0">
<app>
<Feature>
<name>0</name>
<FeatureID>default</FeatureID>
<param>MaxVoiceMessageLength</param>
<value>120s</value>
</Feature>
<Feature>
<name>96</name>
<FeatureID>default</FeatureID>
<param>MCNType</param>
<value>CLIAggregation</value>
</Feature>
<Feature>
<name>97</name>
<FeatureID>default</FeatureID>
<param>SM_HOUR_FORMAT</param>
<value>24_HR</value>
</Feature>
<Feature>
<name>99</name>
<FeatureID>default</FeatureID>
<param>MCNRecordsOrder</param>
<value>LIFO</value>
</Feature>
</app>
</sys>
</config>
This is Python script I am using to Parse the XMl to get "param" and "value" tag.But findall is return empty.
import xml.etree.ElementTree as ET
import sys
def modifycos():
tree = ET.parse(cos1.xml)
root = tree.getroot()
for cos in root.findall('./config/sys/app/Feature')
parameter = cos.find('param').text
parmvalue = cos.get('value')
print(parameter, parmvalue)
modifycos()
(MaxVoiceMessageLength, '120s') (MCNType, 'CLIAggregation') (SM_HOUR_FORMAT, '24_HR') (MCNRecordsOrder,'LIFO')