3 ms·
"If it looks like a document, use XML." And the reason for that is XML originated from SGML and both were initially focused on marking up documents (where ev
by jdnier 10y ago
"If it looks like a document, use XML." And the reason for that is XML originated from SGML and both were initially focused on marking up documents (where everything is ordered, just like the words in this sentence), not objects or bits of data. And that's why JSON is usually simpler and more useful for your example and similar. Whether or not the order is significant in your XML example becomes a schema-level issue (DTD, Relax, XMLSchema). Maybe you are being forced to use XML, but if not, you're describing an object, so use JSON.
- Pxtl 10y agoYes, but xmlschema allows for a decent platform-agnostic system for defining objects. The problem is that most tools default (or even force) to "sequence" instead of "all". With "all" you get object-ish XML behavior. There is no well-adopted analog to xmlschema for json.