|
|
|
|
|
by mortarion
299 days ago
|
|
I mean, at least JSON has a native syntax to indicate an array, unlike XML which requires that you tack on a schema. <MyRoot>
<AnElement>
<Item></Item>
</AnElement>
</MyRoot> Serialize that to a JavaScript object, then tell me, is "AnElement" a list or not? That's one of the reasons why XML is completely useless on the web. The web is full of XML that doesn't have a schema because writing one is a miserable experience. |
|
Consider the following example:
Most parsers have type aware parsing, so that if somebody tucks string to a place where you expect integer, you can get an error or nil or "0" depending on your choice.