W3C User Interface Domain

Extensible Stylesheet Language (XSL)

XSL is a language for expressing stylesheets. It consists of two parts:

An XSL stylesheet specifies the presentation of a class of XML documents by describing how an instance of the class is transformed into an XML document that uses the formatting vocabulary. For background information on style sheets, see the Web style sheets resource page. XSL is developed by the W3C XSL Working Group (members only) whose charter is to develop the next version of XSL.

News

Older News.

Specifications and Working Drafts

The latest versions of the XSL specification are:

Some of them have been translated from English and are available in other languages.

Learning XSL

XSL Frequently Asked Questions maintained by Dave Pawson. Not a tutorial, but a very good source for learning XSL.

XSL Concepts and Practical Use by P. Grosso and N. Walsh was presented at the XML Europe 2000 Conference in Paris, France.

A short XSL tutorial is provided by XML101.

XSLT Programmer's Reference by Mike Kay is probably the first book dedicated to XSLT and XPath.

Training material is available for sale from Crane Softwrights Ltd: Practical Transformation Using XSLT and XPath. It covers the transformation part of XSL (XSLT), including XPath.

Chapter 14 of the XML Bible is dedicated to XSLT, Chapter 15 is dedicated to XSL-FO. Both are available online.

Miloslav Nic has provided code samples demonstrating basic and advanced concepts in his online resource. He has also published a complete XSLT Reference.

A nice introduction to XSLT, the transformation part of XSL, can be found in the Microsoft XSL document.

A good way to learn is by example, so have a look at the XSL Slidemaker from the Koala Group at INRIA/Sophia, which takes an XML file of slides and processes them with XSL.

Other XSL Resources include

XSL-enabled software

XSLT Processors

XSL-FO processors

XSL-Enabled Authoring Tools

Older Implementations

Frequently Asked Questions

How is XSL different from CSS?
XSL uses a XML notation, CSS uses its own. In CSS, the formatting object tree is almost the same as the source tree, and inheritance of formatting properties is on the source tree. In XSL, the formatting object tree can be radically different from the source tree, and inheritance of formatting properties is on the formatting object tree.

Aside from these technical differences, mature implementations of CSS1 and (parts of) CSS2 are available, whilst XSL is currently too new to have mature browser and content-authoring support.

Will XSL replace CSS?
No. They are likely to co-exist since they meet different needs. XSL is intended for complex formatting where the content of the document might be displayed in multiple places; for example the text of a heading might also appear in a dynamically generated table of contents. CSS is intended for dynamic formatting of online documents for multiple media; its strictly declarative nature limits its capabilities but also makes it efficient and easy to generate and modify in the content-generation workflow. So they are two different tools; for some tasks, CSS is the appropriate choice and for some tasks, XSL. They can also be used together - use XSL on the server to condense or customize some XML data into a simpler XML document, then use CSS to style it on the client.
How is XSL different from DSSSL? From DSSSL-O?
DSSSL is an International Standard style sheet language. It is particularly used for formatting of print documents. DSSSL-O is a profile of DSSSL which removes some functionality and adds capabilities to make it more suited for online documentation. XSL draws on DSSSL and the DSSSL-O work and continues the trend towards a Web-oriented style sheet language by integrating experience with CSS.
Will XSL replace DSSSL?
DSSSL has capabilities that XSL does not, and continues in use in the print publishing industry. Experience with XSL might be used in a future revision of DSSSL, but it is too early to say.
So, CSS is for HTML and XSL is for XML?
No, CSS can be used with HTML and also with XML, provided that the XML document has a reasonably linear structure that can be displayed without extensive manipulation. See the CSS2 Recommendation for details.

XSL is targeted at XML, in particular highly-structured, data-rich documents that require extensive formatting.

Should I render all my XML documents to HTML on the server?
Unless you are very careful to retain semantics, no. XSL can be used server-side and client-side. The XSL Submission has two classes of output: DSSSL-style flow objects and HTML tags. Unfortunately, the combination of server-side processing and HTML tag output can result in completely inaccessible, hard to search, hard to index presentational HTML (the sort that is a mass of FONT and BR tags, spacer gifs - you know, the sort of single-shot presentational mess that style sheets were designed to avoid).

The trouble is that by "rendering" to HTML, all that remains of your carefully crafted XML semantics are the presentational aspects - block element, this font, that weight - which makes it hard to generate decent HTML.

Technical: how do I do X, Y or Z in XSL?
First, have a look at D. Pawson's excellent XSL FAQ. If you don't find an answer, check the XSL mailing list at mulberrytech.com.

Max Froumentin <mf@w3.org>
W3C Staff contact, XSL
Last modified: $Date: 2000/10/15 14:21:30 $

Valid HTML 4.0!

Copyright  ©  1997 - 2000 W3C (MIT, INRIA, Keio ), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply. Your interactions with this site are in accordance with our public and Member privacy statements.