Skip to content

Convert xml to json #305

@Sriram1404

Description

@Sriram1404

I am getting the API response as following XML,
<a> <b ID="0"> <c>10020</c> <d>NEWYORK</d> <e>NY</e> </b> <b ID="1"> <c>06373</c> <d>OLDLYME</d> <e>CT</e> </b> </a>

I want to convert the above xml to json as follows,

{ "b": [ { "c": "10020", "d": "NEWYORK", "e": "NY" }, { "c": "06373", "d": "OLDLYME", "e": "CT" } ] }

I have already tried U.xmlToJson(), U.fromXmlWithoutAttributes() but unable to achieve the above expected result.(Skip the root element <a> and also skip xml element attributes("ID") ). Please let me know will this achieved by using Underscore-lib?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions