Extensible Stylesheet Language Transformations (XSLT)

Transform XML documents to different forms

Extensible Stylesheet Language Transformations (XSLT) allows you to describe transforms from an input XML document to an output tree, such as XML, HTML, or text. You can use it for sophisticated presentation of XML documents or for transforms from one XML format to another. Delve further into this successful language and discover what it, as well what EXSLT, can do for you.

Contributors:  W3C

25 April 2007 (First published 06 February 2007)

Extensible Stylesheet Language Transformations (XSLT) allows you to describe transforms from an input XML document to an output tree, such as XML, HTML, or text. You can use it for sophisticated presentation of XML documents or for transforms from one XML format to another. Delve further into this successful language and discover what it, as well what EXSLT, can do for you.

Extensible Stylesheet Language Transformations (XSLT) Version 1.0 [W3C Recommendation] is a language for describing transforms from an input XML document to an output tree. The output tree can, for example, take the form of an HTML document or another XML format, and as such, XSLT can be a language for rendering XML into legacy browser display form or for scripted operations on XML files. The transform is itself defined as an XML document in a special vocabulary. XML Path Language (XPath) is used for accessing the source document and general expression processing, and there are special instructions for setting up processing rules (XSLT is a declarative language) and directing the creation of the output tree.

XSLT 1.0 is an extraordinarily successful language, and it covers most common XML processing tasks. If you're familiar with XML, it is easy to learn the basics of XSLT, though mastering the language takes some effort. It has a well-designed extensibility mechanism, and its declarative processing model allows for maintainable and reusable code. The standard way to link an XML document to its XSLT stylesheet document is defined in Associating Style Sheets with XML documents Version 1.0 [W3C Recommendation]. The XSLT specification has been widely translated.

EXSLT and XSLT 2.0

As mentioned, XSLT has a nice extension mechanism with which you can define additional capabilities using the language of your choice. But it's even nicer when you don't have to write extensions because someone else has done so for you. EXSLT [community specification] is a standard set of such extensions defined in an implementation-agnostic way. EXSLT attempts to cover the most commonly needed extensions, such as date processing, regular expressions, and mathematical operations. Many XSLT implementations implement one or more EXSLT modules.

XSLT Version 2.0 offers some key improvements based on collective experience with XSLT 1.0, but it is closely tied to XPath 2.0, which is somewhat controversial.

Resources

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=XML
ArticleID=193460
SummaryTitle=Extensible Stylesheet Language Transformations (XSLT)
publish-date=04252007