Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

developerWorks Community:

  • Close [x]

Extensible Stylesheet Language Transformations (XSLT)

Transform XML documents to different forms

Contributors:  W3C

Summary:  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.

Date:  25 Apr 2007 (Published 06 Feb 2007)
Level:  Intermediate

Activity:  5429 views
Comments:  

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

Comments



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