this post was submitted on 16 Aug 2026
594 points (99.0% liked)
Open Source
48669 readers
786 users here now
All about open source! Feel free to ask questions, and share news, and interesting stuff!
Useful Links
- Open Source Initiative
- Free Software Foundation
- Electronic Frontier Foundation
- Software Freedom Conservancy
- It's FOSS
- Android FOSS Apps Megathread
Rules
- Posts must be relevant to the open source ideology
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
- !libre_culture@lemmy.ml
- !libre_software@lemmy.ml
- !libre_hardware@lemmy.ml
- !linux@lemmy.ml
- !technology@lemmy.ml
Community icon from opensource.org, but we are not affiliated with them.
founded 7 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
You have it mostly backwards. XML has like 40+ types that are all standardized. JSON only has the basic JS types. XML is a superset of JSON when it comes to types.
How would you represent a double float, or binary data, or a datatime in JSON. You would have to use strings in JSON. In XML you would use the xsd:double, xsd:binary, and xsd:dateTime.
JSON only works if you think in JavaScript. For languages with more complete / complex data systems it does not do unless you resort to the string thing.
For your information:
Easier to read: https://www.ibm.com/docs/en/jfsm/1.1.2.1?topic=queries-xsd-data-types
The official spec: https://www.w3.org/TR/xmlschema-2/
As for validation I think “right tool for the right job” is the best approach here. How do you know your validator is validating correctly? That’s the beauty of XML. Validation is part of the spec. XML is more complicated, but only because it’s more capable than json. Just like protobuf is more complicated than JSON. It’s also more complicated and not centered on JSON types.