xmltodict()

<?xml version = "1.0" encoding = "utf-8"?>
<!-- xslplane.1.xml -->
<?xml-stylesheet type = "text/xsl"  href = "xslplane.1.xsl" ?>
<plane>
   <year> 1977 </year>
   <make> Cessna </make>
   <model> Skyhawk </model>
   <color> Light blue and white </color>
</plane>

Read XML data into a Python dictionary

Output

Function XML to Dict

output

Output

Reference : https://www.journaldev.com/19392/python-xml-to-json-dict

ศึกษาเพิ่มเติม

Last updated

Was this helpful?