sanand0 / xmljson

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

How to Convert Back to XML? #39

Open achapkowski opened 5 years ago

achapkowski commented 5 years ago

Sorry if I missed this, but how do I convert my json back to XML?

from xmljson import BadgerFish              # import the class
bf = BadgerFish(dict_type=dict)      # pick dict class
data = bf.data(fromstring(xml_string))
print(data)

This prints JSON.

Let's say I modify the JSON and want to dump it back to XML. Can I do that?