29 ms·
How so? The JSON model is much more restricted than XML. For example: * In XML an "object property" can be represented as either an attribute or an element, in
by kanox 6y ago
How so? The JSON model is much more restricted than XML. For example:
* In XML an "object property" can be represented as either an attribute or an element, in JSON only dicts can have attributes.
* In XML elements can contain a mix of text and child elements. For serializing objects this is almost never desired.
* JSON has a single way to define lists, in XML you need to roll your own.
- GoblinSlayer 6y agoIn JSON "object property" is not synonymous to "dict", dict is just one of many ways to express object properties. JSON can contain a mix of differently typed objects too, which is similarly meaningless for serialization. And serialization is not the only usage of json. JSON has a concept of list, but lists can be defined in many ways. And list is not the only collection type one might want to express in json. For example, is package dependency list a list or a dict?