3 ms·
The main problem with comparing XML and JSON is that their use cases don't perfectly overlap. I work with complex text documents, typically encoded in TEI schem
by Finnucane 11y ago
The main problem with comparing XML and JSON is that their use cases don't perfectly overlap. I work with complex text documents, typically encoded in TEI schema, and it would be insane to try to do this work in JSON. It's possible, but the result would be an incomprehensible mess.
Unfortunately, a lot of programming languages have poor support for XML, and standard libraries usually only give you XPath 1.0 compatibility. XPath 2.0 and XQuery 3.0/3.1 are far more powerful and flexible, but you need Saxon or a good XML database to make proper use of them.
- ingenter 11y agoI am yet to see an example that makes me say "this JSON file does not represent the data very well, I wish they used XML instead". Representing HTML/XML does not count.
- Jach 11y agoIf you ever do, https://www-01.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0/com.ibm.dp.doc/json_jsonxconversionexample.html https://www-01.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0/... is ready to help you out...
- falcolas 11y agoEncode a hash table where key order matters (like the Python OrderedDict). Or a hash table with non-string keys (like a sky chart with XY coordinates). Or any other data structure which doesn't conform to a simple list/hash table format. Right tool for the job. JSON is a great 80% encoding format, which handles most cases. The problem is that folks try to make it handle all cases (ironically, just like they did with XML).
- padraic7a 11y agoI've done a bit of xml encoding myself, more custom schemas than TEI but I've dabbled in TEI a little too. I think xml is wonderful as an encoding language for text, and can't see anything else replacing it in the near future - unless someone comes up with a really extensible, and easy to use wysiwyg editor. I think the lack of available open source processors is a pain. I remember doing a college assignment and getting really frustrated because my xslt wouldn't produce what I expected - it turns out the Home Edition of Saxon didn't implement this. I wonder Saxon's better implementations being closed source hurt the spread of XSLT and Xquery at a crucial time?