Re:Show HN: Xmljson a Swift CLI Tool to Convert XML to JSON
by p51ngh on Friday May 15, 2020 @12:33PM
(#23194096)
For your sample code Python xmltodict gives:
Your code gives:
Which one's more accurate?!!
[ Parent
| on HN ]
Re:Show HN: Xmljson a Swift CLI Tool to Convert XML to JSON
by alihilal94 on Friday May 15, 2020 @12:43PM
(#23194217)
Thanks for your question.
Both are correct, but if you think about it we have a Bookstore with multiple books so putting them in an array of objects makes more sense.. we don't need the root element name. xmltodict just puts extra unnecessary complexity