Joined March 2012
·
Posted to
Don't waste time on XML, json ftw
over 1 year
ago
The main reason you'd want XML is if you need that extra layer of complexity to your data...granted, you can do "attributes" in your json if you structure your data that way.
Achievements
15 Karma
386 Total ProTip Views
Charity
Fork and commit to someone's open source project in need
I agree completely. Just saying that JSON doesn't have that extra layer of complexity unless you build it into your data structures. For example: "<mytag type='thing' operator='add'><item>3</item><item>4</item></mytag>" would translate to something like: myjson = {type:'thing',operator:'add',items:[3,4]}. So yes, JSON is much simpler. Still, there are pros and cons to both, just like everything else.