XML.com 
 Published on XML.com http://www.xml.com/pub/a/1999/06/xsl_edit.html
See this if you're having trouble printing code examples

 

The XSL Debate: One Expert's View
By Norman Walsh
June 08, 1999

This article addresses the recent debate about the merits of XSL. It is the personal opinion of the author. It was written in preparation for an online chat forum in which the author participated as one of the "experts", hence the title.

Recently, there has been some debate about the merits of XSL (the extensible style language, one of the original family of XML standards). This debate has taken place on several mailing lists and, most recently, was the featured topic on XML.com.

My own experience with structured markup and stylesheets is extensive. I've written stylesheets using FOSIs, CSS, DSSSL, and XSL. Before my SGML days, I wrote them in TeX and LaTeX, I dabbled in Troff and my own home-grown formatters generating raw PostScript, and even an old IBM mainframe system called simply "Script". Several people have asked my opinion about the XSL debate, so here it is. What follows are my own observations and my personal feelings about the issue.

Mostly, I find the whole debate rather disappointing. Disappointing because much of the debate seems to be framed in the most polarizing language possible and hardly seems designed to engender serious discussion.

In any discussion of this nature, it's important to consider the motivations of the various speakers, so let me make mine perfectly plain. I've been a member of the XSL committee since its inception and I've invested a lot of time and effort attempting to make sure that it will solve the problems that I plan to attack with it. It's difficult for me to be completely dispassionate about the issues, although I will try. I also have a document-centric view of the world. While I fully understand the benefits of using XML for data, and I expect to reap rewards from it, at the end of the day, I need to render most of my XML documents so that they can be read (one way or another) by a human being.

I find the debate about XSL difficult to take seriously because XSL seems so obviously useful and necessary to me. One of XML's great strengths is the fact that it gives authors and document creators the ability to use semantically meaningful tags. This strength is a key component of one of XML's greatest selling points: reuse. Tagging something as a <product-number> means that it can be used to drive invoices, product catalogs, and bills of sale. It allows intelligent searching of document databases, and it allows a rendering system to present it in a meaningful way to the end user (be that print, online, speech, braille, or some distant smell-o-vision application).

If the product number was tagged as <bold-blue-italic>, because that was the presentation that was desired for (one of) the rendered versions, it would be impossible to tell product numbers from other things presented in bold, blue italics. This would eliminate whole classes of applications, make searching less accurate, and make rendering in other media more difficult.

The use of semantic tagging makes a powerful stylesheet language an absolute necessity. There has to be some way to render semantic markup in presentational terms. In practice this requires the ability to:

Almost all of the arguments against XSL seem to neglect the fact that transforming semantic markup into presentational markup is just that, a transformation. The document that is displayed is not the same as the source document. The extent of the transformation varies, with styled web content at one end of the spectrum, perhaps, and high-quality, high-resolution, layout-driven, four-color printing at the other.

In order to effectively render content, you need two things: a standard language for expressing the layout that is desired (in XSL, the formatting objects), and a facility for transforming the source document into the layout document (in XSL, the transformation language). Decorating the source tree is not sufficient for most applications.

It happens that one common formatting language is HTML, so it's useful to render semantic content by translating it into HTML and treating HTML as a sort of "RTF for the web." But in the long-run XSL will offer much more than that. XSL includes a standard vocabulary of formatting objects, with well-defined CSS properties to control them. These formatting objects allow stylesheet authors to produce high-quality print output. Future versions of XSL will extend the vocabulary, enabling applications to produce the highest quality print rendering in a standard way. This will also allow content publishers to have a single set of stylesheets that will work in multiple media with different applications. And as the rendering capabilities of monitors improve, and the sophistication of browsers increase, the difference between online and print applications will decrease, reducing the need for widely different stylesheets for them.

As I've watched the debate, I've heard a number of arguments against XSL. Here are my reactions to a few of them.

The future of richly structured, accessible web documents is XML and a stylesheet language with enough richness to present them well in a variety of media. In an acronym, XSL.

Copyright © 1999 by Norman Walsh, nwalsh@arbortext.com

XML.com Copyright © 1998-2006 O'Reilly Media, Inc.