XML.com: XML From the Inside Out
oreilly.comSafari Bookshelf.Conferences.

advertisement

What's the Big Deal With XSL?

April 22, 1999

What's the Big Deal with XSL?

1 Introduction

Late Breaking News

The XSL developers have just released the 19990421 Working Drafts of XSLT (Transformation) and of XSL (Formatting Semantics), too late to be incorporated in this article already in final production. The latest draft claims to be feature complete for transformation, and changes the syntax in the stylesheets used to render this article, but doesn't change the essence of this article.


Editor's Note

There are actually three versions of this article. The one you are currently reading has been formatted to fit into our publishing system and split into pieces. When the author refers to "this article" he is actually referring to one or both of the single-document versions. Both of these versions require IE5. If you have IE5 installed, you can view the HTML 4.0 version and an XML version of this document.


Colophon

This article was written using XML and a Document Type Definition (DTD) crafted to support the concepts in the article. The source file is named "gkh-19990418.xml" and the DTD is named "xmlcom.dtd".

To produce the static HTML, I created the stylesheet named "/1999/04/holman/xmlcom.xsl" and ran James Clark's XT XSL Processor Version 19990307.

To display the XML on the fly, I created the stylesheet named "xmlcom.msxsl" and geared the stylesheet for Internet Explorer 5 (IE5) Version 5.00.2014.0216.

The XML.com published version of this article was produced through custom publishing processes.

I believe that XSL is indeed a big deal; exciting stuff (to the extent that formatting software can be). In this article, I will share my excitement with XSL and my perplexity about the perceived controversy over XSL and Cascading Stylesheets (CSS).

It is not my intention in this short article to try to teach you how to write the syntax of XSL. I'm trying for an overview to help you understand the role that it plays, the relationship of this technology to other technologies, and the direction XSL is going. I've included pointers to places where you can learn more about the nuts and bolts of XSL. Finally, I've used two different implementations of XSL (unfortunately requiring two different stylesheets when there should only be one; more about that later): one to create an HTML 4.0 version of this article, the other to display the live XML.

1.1 Caveats

Off the top I'll share with you that my bugaboo regarding stylesheets (or any other development project) is maintenance. When writing a stylesheet for myself, and especially when writing one for others, planning for future maintenance, tweaking and modification is key. XML and the World Wide Web Consortium (W3C) XSL features supporting the maintenance of large stylesheets gives us, the stylesheet writers, a platform upon which we can build robust and maintainable works.

I'll confess that the stylesheet used to present this article is a bit over the top regarding indexes and cross references, as these illustrate the rich presentation power of XSL. As a result, the rendered HTML version of this document is quite lengthy, but the information in the article, when transmitted to the browser as XML, is much smaller (less than half the length of the HTML).

The development of the XSL recommendation is still in the formative (though not infant) stages. The working drafts are described below and the information contained herein is up to date as of mid-April 1999. For information on further developments of this recommendation, please pursue the links listed below under Where to Learn More About XSL.

2 The Processes of Styling Information

I think about styling structured information as comprising two major processes: transforming the source information into the organization desired for rendering, and rendering the organized information into the presentation desired for consumption.

The latter of these, the rendering of information, itself has two major components: the semantics of style interpreted by the rendering engine (what effects you can achieve) and the expression of those semantics (what the stylesheet looks like).

The XSL developers are addressing this latter process by actively contributing to the W3C Common Formatting Model and have incorporated CSS2 semantics in the XSL formatting semantics. XSL also addresses the former process with powerful transformation facilities to organize our information for rendering purposes.

The controversy I alluded to in my introduction is the loud ruckus heard lately of "why have XSL when we already have CSS"? There need not be controversy. When I use XSL now for styling to the screen (as I have for this article) I use XSL for transformation and generate ordinary CSS semantics and syntax for rendering. The (still-incomplete) XSL formatting facilities will be a superset of CSS semantics and will be in an XML syntax to accommodate the extra functionality required for the powerful semantic concepts being devised. Current users of CSS semantics and syntax, who are satisfied with the functionality provided therein, can continue to use XSL transformation to render their information to HTML/CSS or XML/CSS. Where's the problem?

This has long been recognized by the W3C and the note Using XSL and CSS Together presents their perspective in a public document.

Pages: 1, 2, 3, 4

Next Pagearrow