Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when 2 children have same name #4

Open
josephernest opened this issue Feb 18, 2014 · 0 comments
Open

Issue when 2 children have same name #4

josephernest opened this issue Feb 18, 2014 · 0 comments

Comments

@josephernest
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant