4 ms·
XML is a data exchange document. It's born out of being a mark-up language, but it's true strength is as a data exchange format that can be self-documenting an
by deafpolygon 3y ago
XML is a data exchange document.
It's born out of being a mark-up language, but it's true strength is as a data exchange format that can be self-documenting and human-readable at the same time.
Yes, it has a tendency to make people's eyes bleed with how verbose it can be. But if you were to open an XML file without knowing its format, or what each entry is supposed to be... it is likely you will understand (or be able to suss out) the purpose of the data being exchanged.
Schemas are very powerful, well-documented, and can be used to validate that an XML document is well-formed. People who tend to hate XML and Schemas tend not to understand how or why this is needed.
Contrary to the article's one point about config: I believe one of XML's strength is as configuration documents. It's better suited to configuration that is meant to be shared between different projects or platforms. If you only need a configuration file for a few keys and values - you're probably going to be fine with anything else.
But if you need to dump a configuration file into a document to be read by another program or exchange, then you're better off using XML because that format is more tolerant and can be well-documented by using Schemas. You can version those schemas, and use XSLT to convert the configuration document into another format that is far more readable.
That said, XML is not an be-all and end-all format for everyone. I believe, more importantly than anything, in using the appropriate tool for the given task. XML is simply not the best tool for every task.