I've just been reading "XML - One Ring to Rule them All..." on Steven Lott's blog, and I completely disagree with his conclusion. I don't want to go through the whole thing point by point, but let me pick out a couple of things:
- I do get tired of people writing that XML is opaque and difficult to read or write. In my experience, the people who write such things have been trying to do XML using notepad, vi, or Emacs. There are plenty of good XML-aware editors around, some of which are free. If you choose to enslave yourself to a plain text editor (that is not XML-aware), in this day and age, it shouldn't come as a surprise that some things seem difficult to do.
- XML is actually brilliant for things like build systems, or indeed for programming languages (e.g. XSLT). Why? Well, I know some people complain (because they are using text editors), but anything written in XML is a first class piece of data. Textual scripting languages are at best second class data. For example, Apache Ant uses an XML build file (control file). The file defines particular build targets which are dependent on other build targets. At run-time, Ant decides what the correct order is for calling the targets. It isn't necessary completely obvious, with a big build, to see just what the call order of the targets will be (and this has nothing to do with it being XML, just that Ant uses a "callback" approach rather than a simplistic procedural approach). For a client, I wrote a sequence of XSLT stylesheets that examined the Ant call structure and then generated an HTML page showing the call sequence that you get for each target in the build. That was reasonably easy to do because the build file is XML. If it has been some arbitrary text format, it could have taken a lot longer, and may not have been a practical option. For all that XML may seem more difficult to read than a textual format, it is easier and simpler to parse, and there are many tools that can help you work with it (e.g. XSLT, XQuery). So if you turn a text format into XML, you change it from being a second class piece of data to being a first class piece of data. In large-scale, enterprise projects, it's really helpful to do that.
XML works well for representing a lot of the data we have to represent (i.e. anything that has a workable hierarchical representation). Editing XML in a plain text editor works badly for most things written in XML. Many discussions around the good and bad of XML seem to boil down to these two points.