I want to print all the values of the \"ClCompiler\" child of \"ItemGroup\" of my xml file.
tree = minidom.parse(project_path)
itemgroup
An alternate solution using ElementTree,
import xml.etree.ElementTree as ET
root = ET.fromstring('''\
''')
for child in root.iter('ClCompile'):
print ET.tostring(child)
While parsing from file,
import xml.etree.ElementTree as ET
tree=ET.parse('text.xml')
root = tree.getroot()
for child in root.iter('ClCompile'):
print ET.tostring(child)