9951 explained code solutions for 126 technologies


pythonRead xml file


from xml.dom import minidom
file = minidom.parse('/tmp/file.xml')
items = file.getElementsByTagName('item')ctrl + c
import minidom

imports module to manipulate XML

minidom.parse(

will parse specified XML file

'/tmp/file.xml'

path to XML file

file.getElementsByTagName(

return list of nodes by tag name