W3C Document Formats Domain

Extensible Stylesheet Language (XSL)

What is XSL?

XSL is a language for expressing stylesheets. It consists of three 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.

XSL is part of W3C's Style Activity, whose work is described in the Style Activity Statement.

Specifications and Working Drafts

See Also

Get Involved

NEWS

  • 13 July Xselerator: a new XSL editor and debugger from Marrowsoft (Windows, free trial version).
  • 10 July libxslt 1.0.0 released by Daniel Veillard.
  • 9 July Oliver Becker has published a translation of XPath 1.0 in German (see the translation page for other languages)

  • 19 June RenderX have released version 2.50 of XEP, a FO formatter.
  • 11 June Oleg Tkachenko has translated XPath1.0 to Russian (see also the translations page).
  • 7 June Whitehill <xsl>Composer is available. It provides a GUI for authoring style sheets (Windows, evaluation version).
  • 7 June Excelon announces Stylus Studio 3.0, an IDE for XML application development, including an XSLT debugger (Windows, evaluation version available)
  • 10 May The second edition of Michael Kay's XSLT Programmer's Reference is now available.
  • 11 Mar a new XSLT tutorial by Don Day (IBM)
  • 11 Mar Antenna House's XSL Formatter version 1.1E has been released
  • 11 Apr a new version of the VBXML's visual XSLT debugger is available
  • 16 Mar X-smiles is an open source browser that does client side XSL (using Xalan and FOP) and can also display SVG and SMIL.
  • 08 Mar a new free XSLT1.1 processor: jd.xslt
  • 16 Feb The requirement documents for XSLT2.0 and XPath2.0 are now available.
  • 05 Feb www-xsl-fo@w3.org: a new mailing list on Formatting Objects has been created at w3c. See the mailing lists pages on w3.org for subscription and archive information.

Old News

Learning XSL

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

XSLT tutorial by Don Day (IBM)

VBXML has reference pages on XSLT and XPath

Using XSL Formatting Objects by J. David Eisenberg, an article in xml.com

Wei Meng Lee has written two articles, an introduction to XSLT, and a paper on using XSLT with WML.

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

An XSL tutorial is provided by w3schools.

Another tutorial is at VBXML.COM.

XSLT Programmer's Reference by Mike Kay is probably the first book dedicated to XSLT and XPath. There is now a second edition, which includes updates on the latest specification and tools, and new examples.

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, as well as an XSL FO 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.

A short XSL Tutorial from Henry Thompson, given at SGML UK in October 1997

An XSLT tutorial in iX magazine in German and English.

Other XSL Resources include

XSL-enabled software

XSLT Processors

  • libxslt and libxml2: the Gnome XML/XSLT libraries (C API, open source)
  • jd.xslt: a free processor that implements the 12 Dec 1.1 Working Draft.

  • MSXML3 is an Internet Explorer add-on from Microsoft which does (among other things) client-side XSLT transforms. Available for download. See also the unofficial MSXML XSLT FAQ.
  • Napa : implements a subset of XSLT but claims to be fast and to allow progressive transformations (free executable for Windows)
  • Unicorn XSLT transformation engine, freely available for Windows.
  • Sun's XSLT Compiler creates a Java program that performs the transformation instructions described by a XSLT file.
  • XSLTC is an XSLT compiler. It takes as input an XSLT stylesheet, and generates C++ code that is expected to have the same behaviour as the source stylesheet.
  • 4XSLT is an XML transformation processor written in Python that implements the XSLT transform language.
  • The InDelv browser implements XSL stylesheets, including the FO part for direct display. It also implements XLink.
  • XSL is integrated into the Microsoft XML processor which is part of Internet Explorer 5. It transforms XML into HTML, which is then displayed using CSS; it does not implement FOs. See conformance notes.
  • iXSLT from Infoteria is a XSLT processor written in C++
  • LotusXSL is a complete implementation of the W3C Recommendations for XSL Transformations (XSLT) and the XML Path Language (XPath)
  • Transformiix is an standalone XSLT processor in C++, and can also be used within Mozilla.
  • Resin is a servlet/JSP engine with integrated XPath and XSLT support.
  • Sablotron is an attempt to develop a fast, compact and portable XSLT processor written in C++
  • Sablot XSLT is an extension of Sablotron for PHP4/Win 32.
  • Saxon is a collection of tools for processing XML documents. It includes a complete implementation of the XSLT 1.0 and XPath 1.0 Recommendations, as well as a Java library.
  • Xalan-Java and Xalan-C++ are a implementations of the W3C recommendations XSLT and XPath. They are provided by the Apache XML Project.
  • The XML Parser for Java v2 from Oracle incorporates support for XSL Transformations (XSLT)
  • XMLwriter is an XML editor that supports XSL, so you can transform the content and style of your XML documents.
  • XT from James Clark is a free Java-based implementation of XSLT.

XSL-FO processors

  • X-smiles is an open source browser that does client side XSL (using Xalan and FOP) and can also display SVG and SMIL.
  • XSL Formatter from Antenna House: an FO processor for Windows. Free evaluation version available.
  • Unicorn Formatting Objects (UFO) is freely available and runs on Windows NT 4.0 and Windows 95. It implements the substantial subset of the Extensible Stylesheet Language (XSL) Version 1.0 specification (W3C Working Draft 27 March 2000)
  • FOP is a XSL FO to PDF converter developed by James Tauber at the Apache Software FoundationXE
  • PassiveTeX is a library of TeX macros which provides a rapid development environment for experimenting with XSL FO.
  • REXP is an early implementation of a Formatting Objects engine based on FOP. It generates PDF files. It's an open source.
  • XEP (formerly known as FOP2PDF) from RenderX is a program for converting XSL FO documents to PDF.

XSL-Enabled Authoring Tools

  • Xselerator from Marrowsoft: a complete XML/XSLT IDE.(Windows, free trial version)
  • 4XDebug: an Interactive XSLT Debugger and Profiler
  • XSLT-process 1.1 available: an Emacs mode for invoking an XSLT processor.
  • XSLdoc is a Java tool that generates HTML documentation from an XSLT stylesheet.
  • XSLTracer from ZVon: a debugging tool that enables to visualize the processing of an XML file

    by an XSLT stylesheet. A perl script turns your XML source and your stylesheet into HTML+JavaScript pages so that your transformation can be viewed in a web browser. Also requires Saxon.

  • selectParameters by Jeni Tennison: an XSLT stylesheet to help you to make stylesheets that do dynamic client-side transformation based on parameters selected by the end user. Works on MSXML.
  • xslide : an emacs mode for XSL stylesheets.
  • eXcelon Stylus Studio 3.0: an XML development environment including an XSLT debugger (Windows, evaluation version downloadable)
  • The IBM XSL Editor application allows a user to import, create, and save XSL style sheets and XML source documents
  • If you don't like the XSLT syntax, maybe you'll prefer XSLScript, by Paul Tchistopolskii, which allows one to write style sheets with a simplified syntax.
  • The XPath Visualiser graphically displays the result of XPath expressions in an XML file (MSXML3/IE5)
  • Whitehill <xsl>Composer is available. It provides a GUI for authoring style sheets (Windows, evaluation version).

Miscellaneous

  • XSLTMark : an XSLT test suite and benchmark test from DataPower
  • XSLTDoc from Jeni Tennison: an XSLT learning tool that helps you browse your stylesheet (Windows).
  • XSLT Standard Library (a SourceForge project): a set of templates for commonly used functions.

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: 2001/07/23 12:16:47 $

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.