Jump to content

XSLT: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m rm stray semicolon
rv redundant intro & entire "standalone" nonsense; there is ALWAYS a source tree w/a root node even if not derived from parsed XML. Example only demos ignoring the rest of the tree.
Line 17: Line 17:
'''Extensible Stylesheet Language Transformations (XSLT)''' is a [[Turing complete]]<ref>https://www.unidex.com/turing/utm.htm</ref><ref>https://www.refal.net/~korlukov/tm/</ref> [[XML]]-based language used for the [[XML transformation language|transformation of XML documents]].
'''Extensible Stylesheet Language Transformations (XSLT)''' is a [[Turing complete]]<ref>https://www.unidex.com/turing/utm.htm</ref><ref>https://www.refal.net/~korlukov/tm/</ref> [[XML]]-based language used for the [[XML transformation language|transformation of XML documents]].


XSLT is a specific kind of [[template processor]] primarily designed to transform XML documents into other XML result documents.<ref name="result_doctype">https://www.w3.org/TR/xslt</ref> Moreover, XSLT is natively capable of producing result documents other than well-formed XML,<ref name="result_nonxml">see e.g., https://www.w3.org/TR/xslt#output, specifying alternate output methods.</ref> and is capable of producing output [[#Example_3_Standalone_XSLT_template|without requiring XML]] as input.<ref name="standalone_xslt">see e.g., Standalone XSLT example in this article.</ref>
XSLT is a specific kind of [[template processor]] primarily designed to "transform" XML documents into other XML documents. The original document is not changed; rather, a new document is created based on the content of an existing one.<ref name="result_doctype">https://www.w3.org/TR/xslt#section-Introduction</ref> The new document may be [[Serialization|serialized]] (output) by the processor in standard XML syntax or in another format, such as [[HTML]] or [[Binary and text files|plain text]].<ref name="result_nonxml">See e.g., https://www.w3.org/TR/xslt#output, specifying alternate output methods.</ref> XSLT is most often used to convert data between different [[XML schema]]s or to convert XML data into [[web page]]s or [[Portable Document Format|PDF]] documents.


As a [[Programming language|language]], its origins lie in [[Functional languages|functional language]] <ref>{{cite web | url=https://www.topxml.com/xsl/articles/fp/ | author=Dimitre Novatchev | title=The Functional Programming Language XSLT - A proof through examples | accessdate=May 27 | accessyear=2006 | work=TopXML}}</ref>, and in text-based pattern matching languages in the tradition of [[SNOBOL]] and [[awk]]. Its most direct predecessor was [[DSSSL]], a language that performed the same function for [[SGML]] as XSLT performs for XML.
As a [[Programming language|language]], XSLT's origins lie in [[Functional languages|functional language]] <ref>{{cite web | url=https://www.topxml.com/xsl/articles/fp/ | author=Dimitre Novatchev | title=The Functional Programming Language XSLT - A proof through examples | accessdate=May 27 | accessyear=2006 | work=TopXML}}</ref>, and in text-based pattern matching languages in the tradition of [[SNOBOL]] and [[awk]]. Its most direct predecessor was [[DSSSL]], a language that performed the same function for [[SGML]] as XSLT performs for XML.


XSLT was produced as a result of the [[Extensible Stylesheet Language]] (XSL) development effort within [[W3C]] during [[1998]]&ndash;[[1999]], which also produced [[XSL-FO|XSL Formatting Objects]] (XSL-FO) and the XML Path Language, [[XPath]]. The editor of the first version (and in effect the chief designer of the language) was
The original document is not changed; rather, a new document is created based on the content of an existing one. The new document may be [[Serialization|serialized]] (output) by the processor in standard XML syntax or in another format, such as [[HTML]] or [[Binary and text files|plain text]]. XSLT is most often used to convert data between different [[XML schema]]s or to convert XML data into [[web page]]s or [[Portable Document Format|PDF]] documents.
[[James Clark (XML expert)|James Clark]]. The version most widely used today is XSLT 1.0, which was published as a [[W3C recommendation|Recommendation]] by the [[W3C]] on [[16 November]] [[1999]]. A greatly expanded version 2.0, under the editorship of [[Michael Kay (software engineer)|Michael Kay]], reached the status of a Candidate Recommendation from the [[W3C]] on [[3 November]] [[2005]].

XSLT was produced as a result of the [[Extensible Stylesheet Language]] (XSL) development effort within [[W3C]] during [[1998]]&ndash;[[1999]], which also produced [[XSL-FO|XSL Formatting Objects]] (XSL-FO) and the XML Path Language, [[XPath]].
The editor of the first version (and in effect the chief designer of the language) was
[[James Clark (XML expert)|James Clark]]. The version most widely used today is XSLT 1.0, which was published as a [[W3C recommendation|Recommendation]] by the [[W3C]] on [[16 November]] [[1999]]. A greatly expanded version 2.0, under the editorship of [[Michael Kay (software engineer)|Michael Kay]], reached the status of a Candidate Recommendation
from [[W3C]] on [[3 November]] [[2005]].


==Overview==
==Overview==
Line 254: Line 250:


Note: In this particular example empty elements, such as the <code>meta</code> element in the <code>head</code>, include a space before the final <code>/&gt;</code>, as was specified in the XSLT stylesheet. This behaviour is not required by the W3C specification for XSLT 1.0 processors, and so these spaces in Literal Result Elements<ref>https://www.w3.org/TR/xslt#literal-result-element</ref> in XSLT may or may not be reproduced in the output depending on different XSLT processor implementations. The presence of this space in empty elements was specified in the HTML Compatibility Guidelines of the XHTML 1.0 specification<ref>https://www.w3.org/TR/2002/REC-xhtml1-20020801/#guidelines</ref> for serving XHTML 1.0 to non-XHTML-capable browsers with a 'text/html' [[MIME#Content-Type|Internet media type]]. It is not applicable to later versions of XHTML or XHTML served as 'application/xhtml+xml'<ref>https://www.w3.org/TR/xhtml-media-types/#media-types</ref>. It is not relevant to the most recent browsers (IE 7, Mozilla Firefox etc). XSLT 2.0 plans to address the problem by providing an 'xhtml' output method.<ref>https://www.w3.org/TR/xslt-xquery-serialization/#xhtml-output</ref>
Note: In this particular example empty elements, such as the <code>meta</code> element in the <code>head</code>, include a space before the final <code>/&gt;</code>, as was specified in the XSLT stylesheet. This behaviour is not required by the W3C specification for XSLT 1.0 processors, and so these spaces in Literal Result Elements<ref>https://www.w3.org/TR/xslt#literal-result-element</ref> in XSLT may or may not be reproduced in the output depending on different XSLT processor implementations. The presence of this space in empty elements was specified in the HTML Compatibility Guidelines of the XHTML 1.0 specification<ref>https://www.w3.org/TR/2002/REC-xhtml1-20020801/#guidelines</ref> for serving XHTML 1.0 to non-XHTML-capable browsers with a 'text/html' [[MIME#Content-Type|Internet media type]]. It is not applicable to later versions of XHTML or XHTML served as 'application/xhtml+xml'<ref>https://www.w3.org/TR/xhtml-media-types/#media-types</ref>. It is not relevant to the most recent browsers (IE 7, Mozilla Firefox etc). XSLT 2.0 plans to address the problem by providing an 'xhtml' output method.<ref>https://www.w3.org/TR/xslt-xquery-serialization/#xhtml-output</ref>

=== Example 3 Standalone XSLT template ===
XSLT processors are capable of producing a result document without relying on an associated XML document. This is useful in situations such as [[transclusion]] of page fragments.

<pre>
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="https://www.w3.org/1999/XSL/Transform"
version="1.0" >
<xsl:output method="html"/>

<xsl:template name="header"><h2>Standard Website Header</h2></xsl:template>

<xsl:template match="/">
<xsl:call-template name="header"/>
</xsl:template>

</xsl:stylesheet>
</pre>


== Template rule processing ==
== Template rule processing ==

Revision as of 02:19, 23 November 2006

XSL Transformations
Filename extension
.xsl, .xslt
Internet media type
application/xslt+xml (Waiting for approval), text/xsl (unregistered)
Developed byWorld Wide Web Consortium
Type of formatStylesheet language
Extended fromXML
Standard1.0 (Recommendation),
2.0 (Candidate Recommendation)
Diagram of the basic elements and process flow of XSLT.

Extensible Stylesheet Language Transformations (XSLT) is a Turing complete[1][2] XML-based language used for the transformation of XML documents.

XSLT is a specific kind of template processor primarily designed to "transform" XML documents into other XML documents. The original document is not changed; rather, a new document is created based on the content of an existing one.[3] The new document may be serialized (output) by the processor in standard XML syntax or in another format, such as HTML or plain text.[4] XSLT is most often used to convert data between different XML schemas or to convert XML data into web pages or PDF documents.

As a language, XSLT's origins lie in functional language [5], and in text-based pattern matching languages in the tradition of SNOBOL and awk. Its most direct predecessor was DSSSL, a language that performed the same function for SGML as XSLT performs for XML.

XSLT was produced as a result of the Extensible Stylesheet Language (XSL) development effort within W3C during 19981999, which also produced XSL Formatting Objects (XSL-FO) and the XML Path Language, XPath. The editor of the first version (and in effect the chief designer of the language) was James Clark. The version most widely used today is XSLT 1.0, which was published as a Recommendation by the W3C on 16 November 1999. A greatly expanded version 2.0, under the editorship of Michael Kay, reached the status of a Candidate Recommendation from the W3C on 3 November 2005.

Overview

The XSLT processor takes two input files - an XML source document, and an XSLT stylesheet file, and produces an output document. The XSLT stylesheet file contains the XSLT program text (or ‘source code’ in other languages) and is itself an XML document consisting of a collection of template rules. Each template rule contains a match condition and a list of instructions to be carried out. The processor analyzes the input XML source document and builds a source tree. It then scans the source tree according to a defined algorithm and finds nodes within the source tree which match some template rule's match condition and then executes the instructions specified within that matching template rule. The XSLT language is declarative — rather than listing an imperative sequence of actions to perform in a stateful environment, the instructions within template rules are processed as if they were sequential instructions, but, in fact, they comprise functional expressions, which are evaluated and ultimately cause nodes to be added to the result tree, which is then finally written to the generated output document.

The XSLT specification defines a transformation in terms of source and result trees to avoid locking implementations into system-specific APIs and memory, network and file I/O issues. For example, the specification does not mandate that a source tree always be derived from an XML file, since it may be more efficient for the processor to read from an in-memory DOM object or some other implementation-specific representation. Output may be in a format not envisioned by the XSLT language's designers. However, XSLT processing often begins by reading a serialized XML input document into the source tree and ends by writing the result tree to an output document. The output document may be XML, but can be HTML, RTF, TeX, delimited files, plain text or any other format that the XSLT processor is capable of producing.

XSLT relies upon the W3C's XPath language for identifying subsets of the source document tree, as well as for performing calculations. XPath also provides a range of functions, which XSLT itself further augments. This reliance upon XPath adds a great deal of power and flexibility to XSLT.

XSLT processors may be delivered as standalone applications, or as software components or libraries intended for use by applications. Many web browsers and web server software have XSLT processor components built into them.

Most current operating systems have an XSLT processor installed. For example, Windows XP comes with the MSXML3 library, which includes an XSLT processor. Earlier versions may be upgraded and there are many alternatives, see the External Links section.

Earlier XSLT processors were interpreters; many more recent processors first compile the XSLT stylesheet (typically into intermediate code) before executing the compiled transformation against some input document. This gives higher performance at the expense of some initial overhead, particularly if several input documents are to be processed with the same XSLT stylesheet which then only has to be compiled once but is then executed several times at high speed.

The W3C finalized the XSLT 1.0 specification in 1999. The XSLT 2.0 specification is currently a Candidate Recommendation.

Examples

Example 1 (transforming XML to XML)

Transforming the XML document

<?xml version="1.0"?>
<persons>
  <person username="MP123456">
    <name>John</name>
    <family_name>Smith</family_name>
  </person>
  <person username="PK123456">
    <name>Morka</name>
    <family_name>Ismincius</family_name>
  </person>
</persons>

by applying the XSLT transform:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="https://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes"/> 
 <xsl:template match="/">
    <transform>
       <xsl:apply-templates/>
    </transform>
 </xsl:template>
 <xsl:template match="person">
     <record>
        <username>
           <xsl:value-of select="@username" />
        </username>
        <name>
           <xsl:value-of select="name" />
        </name>
     </record> 
  </xsl:template>
</xsl:stylesheet>

results in a new XML document, having another structure:

<?xml version="1.0" encoding="UTF-8"?>
<transform>
   <record>
      <username>MP123456</username>
      <name>John</name>
   </record>
   <record>
      <username>PK123456</username>
      <name>Morka</name>
   </record>  
</transform>

Example 2 (transforming XML to XHTML)

Example of incoming XML document:

<?xml version="1.0" encoding="UTF-8"?>

<domains>
    <sun.com ownedBy="Sun Microsystems Inc.">
        <host>
            www
            <use>World Wide Web site</use>
        </host>
        <host>
            java
            <use>Java info</use>
        </host>
    </sun.com>
    
    <w3.org ownedBy="The World Wide Web Consortium">
        <host>
            www
            <use>World Wide Web site</use>
        </host>
        <host>
            validator
            <use>web developers who want to get it right</use>
        </host>
    </w3.org>
</domains>

Example XSLT Stylesheet:

<?xml version="1.0" encoding="UTF-8" ?>

<xsl:stylesheet version="1.0" 
        xmlns:xsl="https://www.w3.org/1999/XSL/Transform" 
        xmlns="https://www.w3.org/1999/xhtml">
    <xsl:output method="xml" indent="yes"
        doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" 
        doctype-system="https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
    
    <!--XHTML document outline--> 
    <xsl:template match="/">
        <html xmlns="https://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
            <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                <title>test1</title>
                <style type="text/css">
                    h1          { padding: 10px; padding-width: 100%; background-color: silver }
                    td, th      { width: 40%; border: 1px solid silver; padding: 10px }
                    td:first-child, th:first-child  { width: 20% } 
                    table       { width: 650px }
                </style>
            </head>
            <body>
                <xsl:apply-templates/>
            </body>
        </html>
    </xsl:template>
    
    <!--Table headers and outline-->
    <xsl:template match="domains/*">
        <h1><xsl:value-of select="@ownedBy"/></h1>
        <p>The following host names are currently in use at
          <strong><xsl:value-of select="local-name(.)"/></strong>
        </p>
        <table>
            <tr><th>Host name</th><th>URL</th><th>Used by</th></tr>
            <xsl:apply-templates/>
        </table>
    </xsl:template>
    
    <!--Table row and first two columns-->
    <xsl:template match="host">
        <!--Create variable for 'url', as it's used twice-->
        <xsl:variable name="url" select=
            "normalize-space(concat('https://', normalize-space(node()), '.', local-name(..)))"/>
        <tr>
            <td><xsl:value-of select="node()"/></td>
            <td><a href="{$url}"><xsl:value-of select="$url"/></a></td>
            <xsl:apply-templates select="use"/>
        </tr>
    </xsl:template>

    <!--'Used by' column-->
    <xsl:template match="use">
        <td><xsl:value-of select="."/></td>
    </xsl:template>
        
</xsl:stylesheet> 

XHTML output that this would produce (whitespace has been adjusted here for clarity):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="https://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <meta content="text/html;charset=UTF-8" http-equiv="Content-Type" />
    <title>test1</title>
    <style type="text/css">
      h1          { padding: 10px; padding-width: 100%; background-color: silver }
      td, th      { width: 40%; border: 1px solid silver; padding: 10px }
      td:first-child, th:first-child  { width: 20% } 
      table       { width: 650px }
    </style>
  </head>
  <body>
    <h1>Sun Microsystems Inc.</h1>
    <p>The following host names are currently in use at <strong>sun.com</strong></p>
    <table>
        <tr>
          <th>Host name</th>
          <th>URL</th>
          <th>Used by</th>
        </tr>
        <tr>
          <td>www</td>
          <td><a href="https://www.sun.com">https://www.sun.com</a></td>
          <td>World Wide Web site</td>
        </tr>
        <tr>
          <td>java</td>
          <td><a href="https://java.sun.com">https://java.sun.com</a></td>
          <td>Java info</td>
        </tr>
    </table>
    
    <h1>The World Wide Web Consortium</h1>
    <p>The following host names are currently in use at <strong>w3.org</strong></p>
    <table>
      <tr>
        <th>Host name</th>
        <th>URL</th>
        <th>Used by</th>
      </tr>
      <tr>
        <td>www</td>
        <td><a href="https://www.w3.org">https://www.w3.org</a></td>
        <td>World Wide Web site</td>
      </tr>
      <tr>
        <td>validator</td>
        <td><a href="https://validator.w3.org">https://validator.w3.org</a></td>
        <td>web developers who want to get it right</td>
      </tr>
    </table>
  </body>
</html>

In a web browser, this XHTML appears as:

File:XSL example.gif
Rendered XHTML

Note: In this particular example empty elements, such as the meta element in the head, include a space before the final />, as was specified in the XSLT stylesheet. This behaviour is not required by the W3C specification for XSLT 1.0 processors, and so these spaces in Literal Result Elements[6] in XSLT may or may not be reproduced in the output depending on different XSLT processor implementations. The presence of this space in empty elements was specified in the HTML Compatibility Guidelines of the XHTML 1.0 specification[7] for serving XHTML 1.0 to non-XHTML-capable browsers with a 'text/html' Internet media type. It is not applicable to later versions of XHTML or XHTML served as 'application/xhtml+xml'[8]. It is not relevant to the most recent browsers (IE 7, Mozilla Firefox etc). XSLT 2.0 plans to address the problem by providing an 'xhtml' output method.[9]

Template rule processing

XSLT stylesheets are declarative, not procedural; rather than defining a sequence of operations to execute, they define rules and other hints applied during processing, according to a fixed algorithm. The algorithm, which is somewhat complicated, is described below, although many of its esoteric details have been omitted.

Every XSLT processor is required to behave as if it had followed the following steps to prepare for the transform:

  1. Read the XSLT stylesheet with an XML parser and convert (abstract, rather) its content to a tree of nodes (the stylesheet tree), according to the XPath data model. "Compile-time" stylesheet syntax errors are detected at this stage. Stylesheets can be modular, so any transclusions (xsl:include, xsl:import instructions) would also be handled at this stage in order to bring template rules and other top-level stylesheet elements from other XSLT documents into the stylesheet tree.
  2. Read the input XML with an XML parser and convert its content to a tree of nodes (the source tree), according to the XPath data model. The stylesheet may reference other XML sources via document() function calls. These are, typically, evaluated at run-time, since their locations may have to be calculated and the function calls may not even be reachable. (The example above does not reference any other source documents.)
  3. Strip whitespace-only text nodes from the stylesheet tree, except those that are descendants of xsl:text elements. This allows nested elements in template rules to be on separate ('pretty') lines in the original XSLT without resulting in unintended whitespace being added to the result tree.
  4. Strip whitespace-only text nodes from the source tree, if xsl:strip-space instructions are present in the stylesheet. This allows 'pretty' input XML to be processed in a manner that ignores extraneous whitespace. (The example above does not use this feature.)
  5. Supplement the stylesheet tree with a trio of built-in template rules that provide default behavior for any node type that might be encountered during processing.
    1. One template rule is provided for processing the root node or any element node; it directs the processor to continue and process each child node.
    2. Another template is provided for any text node or attribute node; it directs the processor to make a copy of that result tree node.
    3. A third template rule is provided for any comment node or processing instruction node; it is a no-op.
Templates, explicitly provided in the stylesheet, will override some or all of these. If the stylesheet contains no explicit template rules, the built-in template rules will result in a recursive source tree descension and only text nodes are copied to the result tree (attribute nodes will not be reached because they are not "children" of their parent elements). This result is generally never desirable, as it tends to be just a concatenation of the non-markup character data from the XML source.

Then, the processor performs the following steps to produce and serialize the result tree:

  1. Create the root node of the result tree.
  2. Process the root node of the source tree. The procedure for node processing is described below.
  3. Serialize the result tree, if desired, according to hints provided in the xsl:output instruction.

When processing a node, the following steps are undertaken:

  1. The best-matching template rule for that node is located. This is facilitated by each template rule's "match" pattern (an XPath-like expression), indicating the nodes to which it can be applied. Each template is assigned a relative priority and import precedence by the processor to help ease conflict resolution. The order of template rules in the stylesheet can also help resolve conflicts between templates which match the same nodes, but it does not affect the order in which nodes are processed.
  2. Template rule contents are instantiated. Elements in the XSLT namespace (prefixed with xsl:, typically; it is the namespace identifier bound to the prefix — not the prefix, itself — that matters) are treated as instructions and have special semantics that guide how they are interpreted. Some result in nodes being added to the result tree; others are control oriented. Non-XSLT elements and text nodes encountered in the template rule are copied, verbatim (namespaces and all) to the result tree. Comments and processing instructions are ignored.

The XSLT instruction xsl:apply-templates, when processed, results in a new set of nodes being selected for processing. The nodes are identified via an XPath expression. Each node is processed in document order (the relative order in which they appear in the original document).

XSLT extends XPath's function library and allows XPath variables to be defined. These variables have different scopes in the stylesheet, depending on where they are defined and their values can originate outside the stylesheet. A variable's value cannot be changed during processing.

Although this procedure may sound complicated, it has the net effect of making XSLT much like other web templating languages. If the stylesheet consists only of a single template rule that matches the root node, everything in the template is essentially copied to the output, except for the XSLT instructions (the 'xsl:…' elements), replaced by computed content. XSLT even offers an abbreviated stylesheet format ("literal result element as stylesheet") for these simple, single-template transformations. However, the ability to define separate template rules greatly increases XSLT's versatility and efficiency, especially when producing output that is very similar to the input.

References

  1. ^ https://www.unidex.com/turing/utm.htm
  2. ^ https://www.refal.net/~korlukov/tm/
  3. ^ https://www.w3.org/TR/xslt#section-Introduction
  4. ^ See e.g., https://www.w3.org/TR/xslt#output, specifying alternate output methods.
  5. ^ Dimitre Novatchev. "The Functional Programming Language XSLT - A proof through examples". TopXML. Retrieved May 27. {{cite web}}: Check date values in: |accessdate= (help); Unknown parameter |accessyear= ignored (|access-date= suggested) (help)
  6. ^ https://www.w3.org/TR/xslt#literal-result-element
  7. ^ https://www.w3.org/TR/2002/REC-xhtml1-20020801/#guidelines
  8. ^ https://www.w3.org/TR/xhtml-media-types/#media-types
  9. ^ https://www.w3.org/TR/xslt-xquery-serialization/#xhtml-output

See also

Community Sites
Braintrove.com How to do things in XSLT
Implementations
Some of these are only libraries for specific programming languages, but some form the basis for command line or shell script utilities for one or more operating systems. Such utilities are either bundled with the libraries or independently maintained, and some are incorporated into other applications, such as database engines and web browsers, in order to add XSLT functionality to them. With the exception of web browsers, such utilities and applications are not listed here.
Implementations for Java
Xalan-Java
SAXON by Michael Kay
XT originally by James Clark
Oracle XSLT, in the Oracle XDK
Implementations for the .NET Framework
Saxon .NET Project Weblog, an IKVM.NET-based port of Dr. Michael Kay's and Saxonica's Saxon Processor provides XSLT 2.0, XPath 2.0, and XQuery 1.0 support on the .NET platform.
Implementations for C or C++
Xalan-C++
libxslt the XSLT C library for GNOME
Sablotron, which is integrated into PHP4
Implementations for Perl
XML::LibXSLT is a Perl interface to the libxslt C library
XML::Sablotron is a Perl interface to the Sablotron processor
Implementations for PHP
XSLT is the PHP4 interface to the Sablotron processor
XSL is the new interface to XSL introduced in PHP5. The extension uses the libxslt.
Implementations for Python
4XSLT, in the 4Suite toolkit by Fourthought, Inc.
lxml by Martijn Faassen is a Pythonic wrapper of the libxslt C library
Implementations for Ruby
Ruby/XSLT is a simple XSLT class based on libxml and libxslt
Sablotron module for Ruby is a ruby interface to Sablotron
Implementations for JavaScript
Google AJAXSLT is an implementation of XSLT in JavaScript, intended for use in Ajax applications.
Implementations for specific operating systems
Microsoft's MSXML library may be used in various Microsoft Windows application development environments and languages, such as Visual Basic, C, and JScript.
Microsoft offers a new XSLT processor in the System.XML component of the .NET Framework.
Implementations integrated into web browsers
(Comparison of layout engines (XML))
Mozilla has native XSLT support based on TransforMiiX.
Safari 1.3+ has native XSLT support, but is unable to perform XSL transformations via JavaScript, a limitation that does not occur in Mozilla or Internet Explorer. This limits the capabilities of Ajax applications that would run in Safari. Safari's XML-parser is also not standards-compliant; it will parse XML strings according to HTML rules. Therefore, under certain circumstances, it will omit data from the DOM tree if it encounters malformed "HTML" — even though it actually encountered valid XML. These errors will propagate to XSL-processed DOM trees.
X-Smiles has native XSLT support.
Opera has partial native XSLT support since Version 9. Notable exceptions include the absence of the document() function.
Internet Explorer 6 supports XSLT 1.0 via the MSXML library (described above). IE5 and IE5.5 came with an earlier MSXML component that only supported an older, nonrecommended dialect of XSLT. A newer version of MSXML can be downloaded and installed separately to enable IE5 and IE5.5 to support XSLT 1.0 through scripting, and if certain Windows Registry keys are modified, the newer library will replace the older version as the default used by IE.
Documentation
XSLT 1.0 W3C Recommendation
XSLT 2.0 W3C Candidate Recommendation
Zvon XSLT 1.0 Reference
XSL Concepts and Practical Use by Norman Walsh
Tutorial from developerWorks (1 hour)
Zvon XSLT Tutorial
XSLT Tutorial
Quick tutorial
What kind of language is XSLT?
XSLT and Scripting Languages
Mailing lists
The XSLT list hosted by Mulberrytech
Blogs
A commentary, news, and evangelism weblog devoted to XSLT
Books
XSLT by Doug Tidwell, published by O’Reilly (ISBN 0-596-00053-7)
XSLT Cookbook by Sal Mangano, published by O’Reilly (ISBN 0-596-00974-7)
XSLT Programmer's Reference (ISBN 1-86100-312-9) by Michael Kay (ISBN 1-86100-312-9)
XSLT 2.0 Web Development by Dmitry Kirsanov (ISBN 0-13-140635-3)
XSL Companion, 2nd Edition by Neil Bradley, published by Addison-Wesley (ISBN 0-201-77083-0)
XSLT and XPath on the Edge (Unlimited Edition) (ISBN 0-7645-4776-3) by Jeni Tennison, published by Hungry Minds Inc, U.S. (ISBN 0-7645-4776-3)
XSLT & XPath, A Guide to XML Transformations (ISBN 0-13-040446-2) by John Robert Gardner and Zarella Rendon, published by Prentice-Hall (ISBN 0-13-040446-2)
XSLT code libraries
EXSLT is a widespread community initiative to provide extensions to XSLT.
FXSL is a library implementing support for Higher-order functions in XSLT. FXSL is written in XSLT itself.