4 ms·
The equivalent of your XML would be: {"name": "bob", "salary": "1e999"}
by jules 13y ago
The equivalent of your XML would be:
{"name": "bob", "salary": "1e999"}
- snowwrestler 13y agoI believe that creates a string with the characters "1e999", not the number 1e999.
- jules 13y agoExactly.
- beagle3 13y agoSame as the XML
- snowwrestler 13y agoI don't think XML does either by itself. The schema will determine which fields are parsed as strings and which are parsed as numbers.
- beagle3 13y agoiff you have a schema, and a parser that actually uses it. I've seen a few DTDs but the vast majority of XML documents don't have a schema or even a DTD to follow. And the vast majority of parsers will not parse anything for you, regardless of schema definitions. Which effectively puts you in the same place as the JSON string.