sanand0 / xmljson

xmlsjon converts XML into Python dictionary structures (trees, like in JSON) and vice-versa.
MIT License
122 stars 33 forks source link

Remove prefiexes #10

Closed Dean-Christian-Armada closed 7 years ago

Dean-Christian-Armada commented 7 years ago

I am aware that the default prefix is "@". but can we remove that?

sanand0 commented 7 years ago

@Dean-Christian-Armada -- you may want to use the Yahoo convention in that case.

>>> from xmljson import yahoo
>>> from xml.etree.ElementTree import fromstring
>>> from json import dumps
>>> dumps(yahoo.data(fromstring('<p id="main">Hello<b>bold</b></p>')))
'{"p": {"id": "main", "content": "Hello", "b": "bold"}}'

Is this what you needed?

Dean-Christian-Armada commented 7 years ago

THANKS!