sanand0 / xmljson

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

Add (Apache) Abdera and (Cisco) Cobra convention #16

Closed dagwieers closed 7 years ago

dagwieers commented 7 years ago

There is at least one other convention for handling XML attributes in JSON, which is also in use by Cisco for the ACI product.

<employees>
    <person>
        <name value="Alice"/>
    </person>
    <person>
        <name value="Bob"/>
    </person>
</employees>

becomes

{ "employees": [
    { "person": {
        "name": {
          "attributes": {"value": "Alice"}
        }
    } },
    { "person": {
        "name": {
          "attributes": {"value": "Alice"}
        }
    } }
] }

It would be nice if this could be supported as well.

You can find more information related to this at: http://wiki.open311.org/JSON_and_XML_Conversion/