xmljson
xmljson copied to clipboard
Arrangement of children not preserved
How do you preserve the arrangement of children with same name?
XML To JSON: Code:
dumps(badgerfish.data(eTree.fromstring('<alice><david>edgar</david><bob>charlie</bob><david>edgar</david></alice>')))
Output:
{"alice": {"david": [{"$": "edgar"}, {"$": "edgar"}], "bob": {"$": "charlie"}}}
Back to XML: Code:
eTree.tostring(badgerfish.etree(loads({"alice": {"david": [{"$": "edgar"}, {"$": "edgar"}], "bob": {"$": "charlie"}}}))[0]).decode('utf-8')
Output:
<alice><david>edgar</david><david>edgar</david><bob>charlie</bob></alice>
This question is about six months old and has zero reply. Is the author of this project still responding to issues, or do we have to consider this project abandoned?
My apologies. I have not had a chance to look at the issues most of this year, and I believe that will continue until November.
Thanks for prompting me to clarify, @chrisinmtown
Thanks @sanand0 for the quick reply, I hear you saying that we cannot expect any changes in the near future.