Jeff, I disagree often and a lot with things you write in your blog; but hey, it’s everyone’s right to have his/her own opinion, isn’t it? Still your opinion matters to me; why would I otherwise even read your blog? I read your blog, because sometimes you come up with really interesting ideas and aspects most people never even thought of. Many programmers take certain ideas as facts; “that’s just the way it is”. They don’t even dare to question them. You question many of these and even if you may not be able to come up with a solution to all problems, your blog at least makes people aware of possible issues, kind of “See this, now see that… see the problem?” and this often causes an “Ohhh” or “Ahah” effect. People start to reconsider their facts and recognize that these are not set in stone.
Back to topic: XML is not a fact. XML is not God-given. XML is an idea. An idea that got popular. XML might be a good solution for some or even many problems, however it may be a poor solution for other problems and even if it works as a solution for some problems, there might still be better solutions than that. You seem to dislike XML and guess what, this is one of the topics I seem to agree with you.
The main problem I have with XML is: For whom is this language actually designed?
A) For human beings, so you have human readable data? Really? Well, as you pointed out before, XML is very hard to read. Easy samples like shown above are still human parsable, but I can give you a 2 MB XML file that will make you cry. XML is not for human beings, it’s too verbose and too complicated once the data file grows beyond certain limits.
B) For computers, so you have a standard way to store arbitrarily data? Certainly not. XML is far from being easily parsable for machines. I can think of 100times easier to parse data formats if it only needs to be machine parsable.
So if XML is neither for A nor for B, what is it good for anyway? I guess it is the try to create a format that is at least somewhat human readable and at least somewhat easy to parse for machines. Bad choice!
Instead I had created two equivalent formats - so that you can always convert between them in a 100% lossless way. One that is very easy for machines to be readable and one that is very easy for human beings to be readable. Sounds like a much better approach to me.
Actually Apple had such an approach. Apple has the old NextStep PLIST format, which is very easy for human eyes to read. And they have a very compact binary format. Both were replaced by XML instead. The NextStep Format is legacy and the binary is not legacy, but it’s not the default format being used either.
Here’s an example for the new XML PLISTs:
http://tinyurl.com/54dv52
Compare this to the old, human readable ones (much more readable):
http://tinyurl.com/5yefeb
There is no description for binary PLISTs; but be assured, these are optimized for being machine readable.