3 ms·
But XML has XPath, XMLSchema and XSLT and JSON doesn't XML has those things because it's data model is hostile to every programming language in existence and y
by EdiX 11y ago
But XML has XPath, XMLSchema and XSLT and JSON doesn't
XML has those things because it's data model is hostile to every programming language in existence and you need tools designed specifically for it to manipulate it concisely.
JSON fits well with the list/map/primitve data model that is common to most scripting languages so those tools aren't needed, you can just use javascript or python, something you use everyday anyway and doesn't look alien.
A similar document would look like this in XML
... plus encoding and schema declaration and also all the garbage involved with dealing with namespaces. Or, at least, don't sing praise to XMLSchema and namespaces if you aren't going to put them in your example.
PS. XML is a markup language, if your data is a text document with markup then XML is a good choice, otherwise leave it alone.