XSL Transformations (XSLT) Specification
Version 1.0

W3C Working Draft 21 Apr 1999

This version:
Latest version:
Previous versions:
James Clark <jjc@jclark.com>


XSLT is a language for transforming XML documents into other XML documents.

XSLT is designed for use as part of XSL, which is a stylesheet language for XML. In addition to XSLT, XSL includes an XML vocabulary for specifying formatting. XSL specifies the styling of an XML document by using XSLT to describe how the document is transformed into another XML document that uses the formatting vocabulary.

XSLT is also designed to be used independently of XSL. However, XSLT is not intended as a completely general-purpose XML transformation language. Rather it is designed primarily for the kinds of transformation that are needed when XSLT is used as part of XSL.

Status of this document

This is a W3C Working Draft for review by W3C members and other interested parties. It is a draft document and may be updated, replaced, or obsoleted by other documents at any time. The material in this draft was previously part of the XSL Working Draft. The XSL Working Group will not allow early implementation to constrain its ability to make changes to this specification prior to final release. It is inappropriate to use W3C Working Drafts as reference material or to cite them as other than "work in progress". A list of current W3C working drafts can be found at http://www.w3.org/TR.

This draft is intended to be "feature complete". The Working Group plans to use future drafts to stabilize the current functionality; it does not intend to add any new functionality in version 1.0.

The XSL WG and the XML Linking WG have agreed to unify XSLT expressions and XPointers [XPointer]. A common core semantic model for querying has been agreed upon, and this draft follows this model (see [6.1 Location Paths]). However, further changes particularily in the syntax will probably be necessary.

This is part of the Style activity.

Comments may be sent to xsl-editors@w3.org; archives of the comments are available. Public discussion of XSL, including XSL Transformations, takes place on the XSL-List mailing list.

Table of contents

1. Introduction
2. Stylesheet Structure
3. Forwards-compatible Processing
4. Data Model
    4.1 Root Node
    4.2 Element Nodes
        4.2.1 Unique IDs
        4.2.2 Base URI
    4.3 Attribute Nodes
    4.4 Namespace Nodes
    4.5 Processing Instruction Nodes
    4.6 Comment Nodes
    4.7 Text Nodes
    4.8 Whitespace Stripping
5. Using the Result Tree
6. Expressions and Patterns
    6.1 Location Paths
        6.1.1 Axes
        6.1.2 Node Tests
        6.1.3 Predicates
        6.1.4 Abbreviated Syntax
    6.2 Expressions
        6.2.1 Basics
        6.2.2 Node-sets
        6.2.3 Booleans
        6.2.4 Numbers
        6.2.5 Strings
        6.2.6 Result Tree Fragments
        6.2.7 Extension Functions
        6.2.8 System Functions
        6.2.9 Lexical Structure
    6.3 Patterns
    6.4 Declarations
        6.4.1 Declaring Keys
        6.4.2 Declaring Extension Functions
        6.4.3 Declaring Locales
7. Template Rules
    7.1 Processing Model
    7.2 Defining Template Rules
    7.3 Applying Template Rules
    7.4 Conflict Resolution for Template Rules
    7.5 Built-in Template Rules
    7.6 Modes
8. Named Templates
9. Creating the Result Tree
    9.1 Creating Elements and Attributes
        9.1.1 Literal Result Elements
        9.1.2 Creating Elements with xsl:element
        9.1.3 Creating Attributes with xsl:attribute
        9.1.4 Named Attribute Sets
    9.2 Creating Text
    9.3 Creating Processing Instructions
    9.4 Creating Comments
    9.5 Copying
    9.6 Computing Generated Text
        9.6.1 Generating Text with xsl:value-of
        9.6.2 Attribute Value Templates
    9.7 Numbering
        9.7.1 Number to String Conversion Attributes
10. Repetition
11. Conditional Processing
    11.1 Conditional Processing with xsl:if
    11.2 Conditional Processing with xsl:choose
12. Sorting
13. Variables and Parameters
14. Messages
15. Combining Stylesheets
    15.1 Stylesheet Import
    15.2 Stylesheet Inclusion
    15.3 Embedding Stylesheets


A. DTD Fragment for XSLT Stylesheets
B. References
    B.1 Normative References
    B.2 Other References
C. Examples
    A Formatting Objects Example
    B XHTML Example
D. Acknowledgements
E. Changes from Previous Public Working Draft