XML2Dict
XML2Dict copied to clipboard
Issue when 2 children have same name
This XML, which has 2 children called "many" will cause a problem :
<?xml version="1.0" encoding="utf-8"?>
<mydocument>
<and>
<many>foo</many>
<many>bar</many>
</and>
<and>
<many>blah</many>
</and>
<plus>element as well</plus>
</mydocument>
Here is the result after XML2Dict
:
{'mydocument': {'and': [{'many': [{}, {}]}, {'many': 'blah'}],
'plus': 'element as well'}}
Problem :
print d['mydocument']['and'][0]['many'][0]
should be 'foo'
, and we get {}
instead.