XML2Dict
XML2Dict copied to clipboard
Easier access to attributes with #attributes
trafficstars
With...
<root>
<blah myattr="foo">Bonjour</blah>
</root>
..., would it be possible to have :
print d['root']['blah']['#myattr'] # foo
instead of (now it is like this) :
print d['root']['blah']['#blah']['myattr'] # foo
Moreover, when I slighly change the original XML, there is sometimes @myattr and sometimes #myattr : would it be possible to simplify this and have only @ or only # ?