3 ms·
It is remarkable, when you think about it, how a language well designed for markup language somehow got transformed into a data exchange language. It's easy to
by crazygringo 4y ago
It is remarkable, when you think about it, how a language well designed for markup language somehow got transformed into a data exchange language.
It's easy to understand why -- pre-XML, data exchange formats were generally binary or otherwise non-readable. But once storage got generous enough that each byte stopped mattering, people looked for a textual data format that was easy to debug, and XML was available.
Still, it does make we wish a happy middle ground could have been found. An open standard something essentially like a compact binary format (similar to protobufs) but with a schema with field names and defined structure required at the top of every file. Which would require a dedicated app to view it, essentially similar to JSON once parsed. (While not transmitting the schema during communications but hard-coding it into the sender and receiver could serve as a poor man's obfuscation.)
- _aleph2c_ 4y agoI think a middle ground has been reached, XSLT 3.0 allows you to transform your XML into JSON and back. The XSLT 3.0 (2017) processor is available to non-Java languages from Saxonica, for Python "pip install saxonpy" (Linux only) If you want to see how to do these XML-to-JSON and JSON-to-XML transforms I have written a little learning repo with a CLI: https://github.com/aleph2c/leaning_xslt https://github.com/aleph2c/leaning_xslt Here is Michael Kay's white paper on Transforming JSON using XSLT 3.0: https://www.saxonica.com/papers/xmlprague-2016mhk.pdf https://www.saxonica.com/papers/xmlprague-2016mhk.pdf Once your data is in a JSON format, you could implement your compact-binary-format idea around it.