Which XML Technologies Are Beautiful?
by Michael DayApril 18, 2007
Beauty
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 in 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.
XML
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 backward 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 gets my vote as one of the most beautiful XML technologies. Both the syntax and semantics are simple and uniform, it is powerful and flexible, and it subsumes and surpasses DTDs, 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 compromise the power and simplicity of the language for short-term implementation convenience. XSLT 2.0 corrects this oversight, but throws 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. Others?
Do any other XML technologies hit the perfect balance between power and simplicity?
Concluding Notes
- 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 thought, maybe don't.
- I think that Schematron may also qualify as a beautiful technology, but I lack sufficient experience with it to do the topic justice.
Share your opinions in our forum.
(* You must be a member of XML.com to use this feature.)
Comment on this Article
| Titles Only | Titles Only | Newest First |
- Examples
2007-08-14 04:57:15 halukasaurus [Reply]
Could you explain the "getting unicode right" comment? In particular, do you mean that it is good because it uses unicode or that it is good to only support a strict subset of unicode (e.g. you cannot put an escape character in text ). I find the fact that it is not full unicode rather annoying.
- Examples
2007-08-14 18:15:38 mikeday [Reply]
XML is defined in terms of UNICODE, which is a good thing, especially in contrast to SGML which predates the introduction of UNICODE and hence has to worry about different character sets, not just encodings.
Also, XML files "know their encoding", which is specified using the UNICODE byte order mark or explicitly in the encoding attribute of the XML declaration. This avoids all the problems that plague text formats with no explicitly declared encoding, which can easily be misinterpreted when read on different platforms.
I think that the restrictions on characters that can occur in an XML document are reasonable considering that XML is a textual format, and that higher level markup should use elements and not legacy control codes. In fact I would go further and disallow the use of the C1 control codes, which often indicate an incorrect encoding declaration (eg. Windows-1252 instead of Latin1). XML 1.1 took this step, but was bogged down with other problems and does not look likely to achieve widespread deployment.
- Examples
- More beautiful XML technologies to come ?
2007-04-30 23:06:56 Alain_COUTHURES [Reply]
I do love DocBook because it is simple and powerful. XML is well suited for representing concepts and DocBook separates text itself from presentation constraints. It is perfect for automation and archive.
SVG is also very nice and it can be used to generate plenty of graphics because there are tools to convert from SVG to PNG !
Yet basic XML technologies are still missing or are not yet standardized. For instance, it is easy to represented dependencies between folders and files with a tree but I have never seen a standard about this.
But I don't like XPL and I have built my own XML script language (http://www.agencexml.com/txs) to perform file loadings and savings, web services calls, multiple transformations and so on...
I also don't like XML technologies which use not the way of thinking of XML : WordML, for instance, is just coming from the binary structures of antique Word...
- XML Ubiquity
2007-04-30 10:11:15 dsynod [Reply]
Yes... XML technologies are beautiful (!) and they seem to have grown into a holistic approach, evolving in every tier of a web application as I mention on my blog: "RIAs favour XML technologies throughout all Web Application Tiers..?" http://synodinos.wordpress.com/2007/04/23/rias-favour-xml-technologies-throughout-all-web-application-tiers/
- Beautiful in my opinion
2007-04-20 15:01:32 dbaechtel [Reply]
I like SyncRO Soft's Oxygen 8.x XML Editor. It gives me much needed features for the price and I can really rock XML and XSD design, testing and documentation with it.
I also like Microsoft's XLINQ to XSD technology. With it I can automatically generate either C# or VB.Net object class code into my application from an XSD file and the Load (read) or Save (write) XML data files to/from these object classes effortlessly as well as many other features. I can access my XML data directly from these object classes with XLINQ SQL-like statements or with much simplier direct object references in C# or VB.Net. It makes working with XSD and XML data files programmatically about as easy as it can be. In Visual Studio I even get Intellisense for my XSD classes to assist me with the coding.
Such as:
// BANG it out !!
// PeopleDB is defined by XSD file
var Pdb = PeopleDB.Load("../../PeopleDB0.xml");
// cnt = # of person in Pdb
int cnt = Pdb.person.Count;
// get name of first person in Pdb
String str = Pdb.person[0].Name.givenname + " " + Pdb.person[0].Name.familyName;
// and show it in a MessageBox
MessageBox.Show(str, "Person", MessageBoxButtons.OK);
Cut from much larger XSD file:
<xs:element name="PeopleDB">
<xs:complexType>
<xs:sequence>
<xs:element name="person" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="PersonName"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="PersonName">
<xs:sequence>
<xs:element name="familyName" type="xs:string" minOccurs="0"/>
<xs:element name="middlename" type="xs:string" minOccurs="0"/>
<xs:element name="givenname" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
See download and documentation at:
http://www.microsoft.com/downloads/details.aspx?FamilyID=f83e69dd-ef73-49c5-9b3a-ee0c61e68a20&DisplayLang=en
They're Really Cool !!
- JAXB
2007-04-19 11:08:54 shmert [Reply]
I've been using JAXB for the first time, and it does exactly what I was hoping it did – generate java classes for elements, which allow easy parsing and generation of a well-defined XML documents, without having to worry one lick about the fact that the documents I'm dealing with are XML. Because personally I find XML to be far from beatiful.
- The beautiful ones...
2007-04-19 01:38:09 philip.fennell [Reply]
In my opinion XSLT (1 & 2) are beautiful and along with them comes Schematron for two reasons.
1) The skeleton implementation in XSLT underpins my belief that XSLT is beautiful.
2) Tt is simplicity itself and can be extended/customised due to the power of XSLT.
Also I'd say the SMIL Animation profile is a work of art too. When you really get into the nitty-gritty of events and sync-bases you can do some really cool stuff without a hint scripting to be seen.
- The beautiful ones...
2007-08-14 23:15:05 Backup-Bro [Reply]
It is a good language fot technical manuals.
Take a look at http://rtf-to-xml.blogspot.com/
- The beautiful ones...
