<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>XSL Transformations (XSLT)</title>
<link rel="stylesheet" type="text/css" href="W3C-REC">
<style type="text/css">p.element-syntax { border: solid thin }code { font-family: monospace }</style>
</head>
<body>
<div class="head">
<h1>XSL Transformations (XSLT)<br>Version 1.0</h1>
<h2>W3C Recommendation 16 November 1999</h2>
<dl>
<dt>This version:</dt>
<dd>
<a href="http://www.w3.org/TR/1999/REC-xslt-19991116">http://www.w3.org/TR/1999/REC-xslt-19991116</a>
<br>
(available in <a href="http://www.w3.org/TR/1999/REC-xslt-19991116.xml">XML</a> or
<a href="http://www.w3.org/TR/1999/REC-xslt-19991116.html">HTML</a>)
</dd>
<dt>Latest version:</dt>
<dd>
<a href="http://www.w3.org/TR/xslt">http://www.w3.org/TR/xslt</a>
<br>
</dd>
<dt>Previous versions:</dt>
<dd>
<a href="http://www.w3.org/TR/1999/PR-xslt-19991008">http://www.w3.org/TR/1999/PR-xslt-19991008</a>
<br>
<a href="http://www.w3.org/1999/08/WD-xslt-19990813">http://www.w3.org/1999/08/WD-xslt-19990813</a>
<br>
<a href="http://www.w3.org/1999/07/WD-xslt-19990709">http://www.w3.org/1999/07/WD-xslt-19990709</a>
<br>
<a href="http://www.w3.org/TR/1999/WD-xslt-19990421">http://www.w3.org/TR/1999/WD-xslt-19990421</a>
<br>
<a href="http://www.w3.org/TR/1998/WD-xsl-19981216">http://www.w3.org/TR/1998/WD-xsl-19981216</a>
<br>
<a href="http://www.w3.org/TR/1998/WD-xsl-19980818">http://www.w3.org/TR/1998/WD-xsl-19980818</a>
<br>
</dd>
<dt>Editor:</dt>
<dd>
James Clark
<a href="mailto:jjc@jclark.com"><jjc@jclark.com></a>
<br>
</dd>
</dl>
<p class="copyright">
<a href="http://www.w3.org/Consortium/Legal/ipr-notice.html#Copyright">
Copyright</a> © 1999 <a href="http://www.w3.org">W3C</a><sup>®</sup>
(<a href="http://www.lcs.mit.edu">MIT</a>,
<a href="http://www.inria.fr/">INRIA</a>,
<a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C
<a href="http://www.w3.org/Consortium/Legal/ipr-notice.html#Legal_Disclaimer">liability</a>,
<a href="http://www.w3.org/Consortium/Legal/ipr-notice.html#W3C_Trademarks">trademark</a>,
<a href="http://www.w3.org/Consortium/Legal/copyright-documents.html">document use</a> and
<a href="http://www.w3.org/Consortium/Legal/copyright-software.html">software licensing</a> rules apply.
</p>
<hr title="Separator for header">
</div>
<h2>
<a name="abstract">Abstract</a>
</h2>
<p>This specification defines the syntax and semantics of XSLT, which
is a language for transforming XML documents into other XML
documents.</p>
<p>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.</p>
<p>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 transformations that are needed when XSLT is used as part of
XSL.</p>
<h2>
<a name="status">Status of this document</a>
</h2>
<p>This document has been reviewed by W3C Members and other interested
parties and has been endorsed by the Director as a W3C <a href="http://www.w3.org/Consortium/Process/#RecsW3C">Recommendation</a>. It
is a stable document and may be used as reference material or cited as
a normative reference from other documents. W3C's role in making the
Recommendation is to draw attention to the specification and to
promote its widespread deployment. This enhances the functionality and
interoperability of the Web.</p>
<p>The list of known errors in this specification is available at
<a href="http://www.w3.org/1999/11/REC-xslt-19991116-errata">http://www.w3.org/1999/11/REC-xslt-19991116-errata</a>.</p>
<p>Comments on this specification may be sent to <a href="mailto:xsl-editors@w3.org">xsl-editors@w3.org</a>; <a href="http://lists.w3.org/Archives/Public/xsl-editors">archives</a>
of the comments are available. Public discussion of XSL, including
XSL Transformations, takes place on the <a href="http://www.mulberrytech.com/xsl/xsl-list/index.html">XSL-List</a>
mailing list.</p>
<p>The English version of this specification is the only normative
version. However, for translations of this document, see <a href="http://www.w3.org/Style/XSL/translations.html">http://www.w3.org/Style/XSL/translations.html</a>.</p>
<p>A list of current W3C Recommendations and other technical documents
can be found at <a href="http://www.w3.org/TR">http://www.w3.org/TR</a>.</p>
<p>This specification has been produced as part of the <a href="http://www.w3.org/Style/Activity">W3C Style activity</a>.</p>
<h2>
<a name="contents">Table of contents</a>
</h2>1 <a href="#section-Introduction">Introduction</a>
<br>2 <a href="#section-Stylesheet-Structure">Stylesheet Structure</a>
<br> 2.1 <a href="#xslt-namespace">XSLT Namespace</a>
<br> 2.2 <a href="#stylesheet-element">Stylesheet Element</a>
<br> 2.3 <a href="#result-element-stylesheet">Literal Result Element as Stylesheet</a>
<br> 2.4 <a href="#qname">Qualified Names</a>
<br> 2.5 <a href="#forwards">Forwards-Compatible Processing</a>
<br> 2.6 <a href="#section-Combining-Stylesheets">Combining Stylesheets</a>
<br> 2.6.1 <a href="#include">Stylesheet Inclusion</a>
<br> 2.6.2 <a href="#import">Stylesheet Import</a>
<br> 2.7 <a href="#section-Embedding-Stylesheets">Embedding Stylesheets</a>
<br>3 <a href="#data-model">Data Model</a>
<br> 3.1 <a href="#root-node-children">Root Node Children</a>
<br> 3.2 <a href="#base-uri">Base URI</a>
<br> 3.3 <a href="#unparsed-entities">Unparsed Entities</a>
<br> 3.4 <a href="#strip">Whitespace Stripping</a>
<br>4 <a href="#section-Expressions">Expressions</a>
<br>5 <a href="#rules">Template Rules</a>
<br> 5.1 <a href="#section-Processing-Model">Processing Model</a>
<br> 5.2 <a href="#patterns">Patterns</a>
<br> 5.3 <a href="#section-Defining-Template-Rules">Defining Template Rules</a>
<br> 5.4 <a href="#section-Applying-Template-Rules">Applying Template Rules</a>
<br> 5.5 <a href="#conflict">Conflict Resolution for Template Rules</a>
<br> 5.6 <a href="#apply-imports">Overriding Template Rules</a>
<br> 5.7 <a href="#modes">Modes</a>
<br> 5.8 <a href="#built-in-rule">Built-in Template Rules</a>
<br>6 <a href="#named-templates">Named Templates</a>
<br>7 <a href="#section-Creating-the-Result-Tree">Creating the Result Tree</a>
<br> 7.1 <a href="#section-Creating-Elements-and-Attributes">Creating Elements and Attributes</a>
<br> 7.1.1 <a href="#literal-result-element">Literal Result Elements</a>
<br> 7.1.2 <a href="#section-Creating-Elements-with-xsl:element">Creating Elements with xsl:element</a>
<br> 7.1.3 <a href="#creating-attributes">Creating Attributes with xsl:attribute</a>
<br> 7.1.4 <a href="#attribute-sets">Named Attribute Sets</a>
<br> 7.2 <a href="#section-Creating-Text">Creating Text</a>
<br> 7.3 <a href="#section-Creatin