Next: Lineage Up: XSL Previous: XSL

Introduction

XML is currently sweeping through the computer industry because of its extreme versatility, power, and simplicity. By providing people with a means for expressing ideas, data, and documents in a portable, standardized, and human-readable form, XML facilitates the availability of more varied forms of data and much richer documents on the Internet. And although these new documents that are appearing on the Internet as a result of XML are standards-compliant, textual, and internationalized, they are also nearly impossible to read. Reading raw XML is simply a skill beyond the capabilities of most human beings. Although tags and nesting may be easily understood by a computer, people need their documents to be formatted, typeset, and laid out before they can even begin to comprehend its contents. And that, in a nutshell, is the reason for XSL.

XSL stands for eXtensible Stylesheet Language. It is a W3C specification for a language that takes an XML document and reformats it into a properly laid out and typeset document that can be read by normal people. The main philosophies behind XSL are obvious from its name: that it be extensible and that it be based on a stylesheet model.

In order to be extensible, XSL was designed as an XML application so that it could take advantage of the easy extensibility features of XML. In addition, the designers of the language attempted to make the capabilities of XSL as generic as possible. Much of the specification is designed to make as few assumptions about documents as possible so that it can take arbitrary documents and reformat them in arbitrary ways to be displayed.

The decision to base XSL on a stylesheet model is part of a larger philosophy at the W3C that content should be separated from rendering. Essentially, the philosophy states that XML documents should contain ONLY data. Any information about how that data should appear on a screen or on a printed piece of paper should be kept completely separate from that document. Although XSL is a language for describing how XML documents should look, all of the content is kept separate. By virtue of being based on the stylesheet model, XSL describes only the styles and formatting that should be applied to a document and nothing else. It is also the only place where this style and formatting information is kept.

One of the primary benefits of a stylesheet model is that data can be reformatted for various needs and various media by using different stylesheets. For example, if you are given a story in XML, and you don't like swear words, you can format the story for display in such a way that the swear words don't show up. Or if you have a complicated web page and try to display it on a cellphone, it's not going to work. But by using different stylesheets, you can take the same content and render the same content in a complicated way for the web but in a simple way for a cellphone. You can take the same data but use different stylesheets to format it for your particular needs.

Personally though, I have very strong reservations with the stylesheet model. I don't believe that it is advisable or even possible to separate content from rendering cleanly because in many cases the style of a document is an innate part of its content and meaning. "The medium is the message" so to speak. The benefits that it provides such as code reuse and ease of data extraction are of interest largely only to computer scientists. As such, I am extremely skeptical about whether the benefits of stylesheet outweigh the disadvantages of greatly increased complexity.


Next: Lineage Up: XSL Previous: XSL

2001-05-11