XML is everywhere, and XML technologies are proliferating across all spheres of IT. Naturally, some XML technologies are more successful than others. However, which XML technologies are beautiful?
Given that beauty is in the eye of the beholder, I had better define some criteria. To me, technology is beautiful when it achieves a balance between power and simplicity, hitting a local maxima in the design space, if you will, such that it cannot be made any simpler without making it less powerful, and it cannot be made any more powerful without losing its simplicity.
Does this help? It still seems rather difficult to objectively determine the power and simplicity of a given piece of technology, so giving an absolute beauty metric may be impossible. However, by considering ways in which a given technology could be made simpler or more powerful, we can get some idea of how much it could be improved, and thus how distant from perfection it is: a relative beauty metric.
As an example, consider the iPod. It is widely considered to be a beautiful piece of technology, but it can clearly be improved. To my knowledge, iPods do not support Ogg Vorbis, an open audio format considered to be superior quality to MP3. Adding support for an additional audio format would clearly increase the power of the iPod, as it could then play a greater variety of audio files. It would not reduce simplicity, as the iPod already supports more than one audio format transparently and the user interface would stay exactly the same. This indicates that the iPod has not yet reached an optimum balance between power and simplicity, and could be made more beautiful than it currently is.
How beautiful is XML? This is a much harder question. Some beautiful aspects of XML are the way it gets UNICODE right, the way it separates well-formedness from validity, and the aesthetic pleasure of open and close tags, which just look nicer than S-expressions no matter how isomorphic to them they may be.
However, it is clear that XML could be more beautiful than it is. For example, XML could be simpler. Numerous proposals have been made for simplifying XML, usually by throwing away more of the features left over from SGML, like external DTDs and parameter entities, which are the source of much complexity in the XML specification.
Given that XML 1.0 was designed as a simplified, streamlined subset of SGML for the web, a future XML 2.0 could continue the simplification process, especially now that backwards compatibility with SGML is much less of a concern that it was ten years ago. A hypothetical XML 2.0 could be simpler and yet more powerful, for example by replacing external entities by XInclude and DTDs by RELAX NG.
Speaking of RELAX NG, it has to get my vote as one of the most beautiful XML technologies. Both the syntax and semantics are simple and uniform, it is powerful and flexible, it subsumes and surpasses DTDs, and yet is actually easier to work with. It is quite difficult to see how RELAX NG could be made any simpler or more powerful than it already is, indicating that it is probably as close to perfection as an XML technology can get.
XPath and XSLT
Another XML technology that looks beautiful to me is XPath, which gives concrete form to the idea of navigating an XML document. I must admit that I find XPath 2.0 less beautiful; the increased power seems outweighed by increased complexity. Perhaps if it was developed independently of XQuery it might have landed at a different spot in the power/simplicity design space.
XSLT could have been a contender, if not for result tree fragments, which compromised the power and simplicity of the language for short-term implementation convenience. XSLT 2.0 corrects this oversight, but does throw in significant extra complexity by tying itself to XSD schema. Nevertheless, given that the schema support is optional, it does seem that XSLT 2.0 is more beautiful.
Do any other XML technologies hit the perfect balance between power and simplicity?
For a more detailed examination of the beauty of XML, see Tim Bray’s Why XML Doesn’t Suck. For the opposing view, just google “xml sucks”.
Do XML Namespaces increase or decrease the beauty of XML? Discuss. On second thoughts, maybe don’t.
I think that Schematron may also qualify as a beautiful technology, but lack enough experience with it to do the topic justice.