xmlfile
Python public recipesRead a XML file and return its content as a dictionary
Shortcut: xml.file.read-as-dict
import xmltodict
import xml
with open("filename", 'r') as xmlfile:
try:
result = xmltodict.parse(xmlfile.read())
except xml.parsers.expat.ExpatError:
# Handling error