Search code examples
xmlhistoryfile-format

What's the point of XML?


What problems was XML invented to solve? From what I can tell, it seems like it specifies a uniform syntax for things that may have vastly different semantics. Unlike, for example, an HTML file, a Java source file, or a .docx document, one cannot write a program to extract any kind of high-level meaning from an XML file without lots of additional information. What is the value of having the syntax rigidly specified by some standards committee even when the semantic meaning is completely unspecified? What advantages does XML have over just rolling your own ad-hoc format that does exactly what you need and nothing more? In short, what does XML accomplish and why is it so widely used?


Solution

  • XML forces your data to be well-structured, so that a program which does not understand the semantics of your data will still be able to understand its syntax. This allows things like XSLT, which will transform one well-formed XML document into another. It means that you can manipulate data without having to interpret it. You can see the document is well-formed and valid according to its DTD without needing to understand the contents.

    This was a huge step forward for data storage, interoperability, and machine-readability in general.