sanand0 / xmljson

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

Arrangement of children not preserved #45

Open roniemartinez opened 4 years ago

roniemartinez commented 4 years ago

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>
chrisinmtown commented 4 years ago

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?

sanand0 commented 4 years ago

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

chrisinmtown commented 4 years ago

Thanks @sanand0 for the quick reply, I hear you saying that we cannot expect any changes in the near future.