It was originally designed for transformingXML documents into other XML documents,[7] or other formats such as HTML for web pages, plain text, or XSL Formatting Objects. These formats can be subsequently converted to formats such as PDF, PostScript, and PNG.[8] Support for JSON and plain-text transformation was added in later updates to the XSLT 1.0 specification.
XSLT 3.0 implementations support Java, .NET, C/C++, Python, PHP and NodeJS. An XSLT 3.0 JavaScript library can also be hosted within the web browser.
Modern web browsers include native support for XSLT 1.0.[9] However usage has always been rather low and declining. It was used by 0.02% of websites in 2013 and 0.001% in 2025.[10] Over the years XSLT repeatedly had severe security vulnerabilities. Google proposed to remove it from Chromium initially in 2013 and later in 2015.[11] Ten years later, after Firefox and WebKit teams indicated their support for removing XSLT,[12][13] Google published a deprecation plan in October 2025.[14][15] A polyfill can be used to support even newer versions of XSLT without native support.[16][17]
The XSLT document transformation specifies how to transform an XML document into new document (usually XML, but other formats, such as plain text are supported).[18] Typically, input documents are XML files, but anything from which the processor can build an XQuery and XPath Data Model can be used, such as relational database tables or geographical information systems.[7]
While XSLT was originally designed as a special-purpose language for XML transformation, the language is Turing-complete, making it theoretically capable of arbitrary computations.[19]
XSLT is often ambiguously referred to as XSL. This is due to XSL-FO using XSLT, the text/xslmedia type,[20] the more common filename extension .xsl[21][22] and xsl: as namespace identifier in official resources, where every tag in the entire XSLT document is prefixed with xsl:.[23]SAP even refers to it as ".xsl language" on its website.[22]
History
XSLT is influenced by functional languages,[24] and by text-based pattern matching languages like SNOBOL and AWK. Its most direct predecessor is DSSSL, which did for SGML what XSLT does for XML.[25]
XSLT 1.0: XSLT was part of the World Wide Web Consortium (W3C)'s eXtensible Stylesheet Language (XSL) development effort of 1998–1999, a project that also produced XSL-FO and XPath. Some members of the standards committee that developed XSLT, including James Clark, the editor, had previously worked on DSSSL. XSLT 1.0 was published as a W3C recommendation in November 1999.[26] Despite its age, XSLT 1.0[27] is still widely used (as of 2018), since later versions are not supported natively in web browsers or for environments like LAMP.
XSLT 2.0: after an abortive attempt to create a version 1.1 in 2001,[28] the XSL working group joined forces with the XQuery working group to create XPath 2.0,[29] with a richer data model and type system based on XML Schema. Building on this is XSLT 2.0,[30] developed under the editorship of Michael Kay, which reached recommendation status in January 2007.[31] The most important innovations in XSLT 2.0 include:
Functions and operators for manipulating dates, times, and durations
Multiple output documents
Grouping (creating hierarchic structure from flat input sequences)
A richer type system and stronger type checking
XSLT 3.0: became a W3C Recommendation on 8 June 2017. The main new features are:[32]
Streaming transformations: in previous versions the entire input document had to be read into memory before it could be processed,[33] and output could not be written until processing had finished. XSLT 3.0 allows XML streaming which is useful for processing documents too large to fit in memory or when transformations are chained in XML Pipelines.
Packages, to improve the modularity of large stylesheets.
Improved handling of dynamic errors with, for example, an xsl:try instruction.
Support for maps and arrays, enabling XSLT to handle JSON as well as XML.
Functions can now be arguments to other (higher-order) functions.
Design and processing model
Diagram of the basic elements and process flow of eXtensible Stylesheet Language Transformations.
The XSLT processor takes one or more XML source documents, plus one or more XSLT stylesheets, and processes them to produce one or multiple output documents.[34][35] In contrast to widely implemented imperative programming languages like C, XSLT is declarative.[36] The basic processing paradigm is pattern matching.[37] Rather than listing an imperative sequence of actions to perform in a stateful environment, template rules only define how to handle a node matching a particular XPath-like pattern, if the processor should happen to encounter one, and the contents of the templates effectively comprise functionalexpressions that directly represent their evaluated form: the result tree, which is the basis of the processor's output.
A typical processor behaves as follows. First, assuming a stylesheet has already been read and prepared, the processor builds a source tree from the input XML document. It then processes the source tree's root node, finds the best-matching template for that node in the stylesheet, and evaluates the template's contents. Instructions in each template generally direct the processor to either create nodes in the result tree, or to process more nodes in the source tree in the same way as the root node. Finally the result tree is serialized as XML or HTML text.
XSLT uses XPath to identify subsets of the source document tree and perform calculations. XPath also provides a range of functions, which XSLT itself further augments.
XSLT 1.0 uses XPath 1.0, while XSLT 2.0 uses XPath 2.0. XSLT 3.0 will work with either XPath 3.0 or 3.1. In the case of 1.0 and 2.0, the XSLT and XPath specifications were published on the same date. With 3.0, however, they were no longer synchronized. XPath 3.0 became a Recommendation in April 2014, followed by XPath 3.1 in February 2017. XSLT 3.0 followed in June 2017.
XSLT functionalities overlap with those of XQuery, which was initially conceived as a query language for large collections of XML documents.
The XSLT 2.0 and XQuery 1.0 standards were developed by separate working groups within W3C, working together to ensure a common approach where appropriate. They share the same data model, type system, and function library, and both include XPath 2.0 as a sublanguage.
The two languages, however, are rooted in different traditions and serve the needs of different communities. XSLT was primarily conceived as a stylesheet language whose primary goal was to render XML for the human reader on screen, on the web (as a web template language), or on paper. XQuery was primarily conceived as a database query language in the tradition of SQL.
Because the two languages originate in different communities, XSLT is stronger in its handling
of narrative documents with more flexible structure, while XQuery is stronger in its data handling, for example when performing relational joins.[38]
Media types
The <output> element can optionally take the attribute media-type, which allows one to set the media type for the resulting output, for example: <xsl:output output="xml" media-type="application/xml"/>. The XSLT 1.0 recommendation recommends the more general attribute types text/xml and application/xml[39] since for a long time there was no registered media type for XSLT. During this time text/xsl[20] became the de facto standard. In XSLT 1.0 it was not specified how the media-type values should be used.
With the release of XSLT 2.0, the W3C recommended in 2007 the registration of the application/xslt+xml media type[40] and it was later registered with the Internet Assigned Numbers Authority.[41]
Pre-1.0 working drafts of XSLT used text/xsl in their embedding examples, and this type was implemented and continued to be promoted by Microsoft in Internet Explorer[42] and MSXML circa 2012. It is also widely recognized in the xml-stylesheet processing instruction by other browsers. In practice, therefore, users wanting to control transformation in the browser using this processing instruction were obliged to use this unregistered media type.[43]
Examples
These examples use the following incoming XML document:
This XHTML generates the output below when rendered in a web browser.
Rendered XHTML generated from an XML input file and an XSLT transformation.
In order for a web browser to be able to apply an XSL transformation to an XML document on display, an XML stylesheet processing instruction can be inserted into XML. So, for example, if the stylesheet in Example 2 above were available as "example2.xsl", the following instruction could be added to the original incoming XML:[44]
In this example, text/xsl is technically incorrect according to the W3C specifications[44] (which say the type should be application/xslt+xml), but it is the only media type that is widely supported across browsers as of 2009, and the situation is unchanged in 2021.
Criticism
XSLT has been criticized as having a steep learning curve,[45] poor readability,[46] poor processing performance,[47][48] and outdated implementations.[49] In addition, some developers prefer to transform XML using a general-purposeimperative programming language over using XSLT.[50][51][52]
Håkon Wium Lie, who was CTO of Opera at the time, said in a 2007 interview that CSS handles most use cases of XSLT.
XSL[a] is a style sheet language often used in print-oriented production lines. CSS and XSL, although sharing a basic formatting model, are quite different in their approach. XSL is a programming language, CSS is not. Is there a need for both languages? I believe CSS can handle most use cases for XSL. For example, Prince has shown that it's possible to create wonderful print publications with CSS. Others will disagree and argue that you, in some cases, need a programming language.
RaptorXML from Altova is an XSLT 3.0 processor available in the XMLSpy development toolkit and as a free-standing server implementation, invoked using a REST interface.
IBM offers XSLT processing embedded in a special-purpose hardware appliance under the Datapower brand.
libxslt is a freelibrary released under the MIT License that can be reused in commercial applications. It is based on libxml and implemented in C for speed and portability. It supports XSLT 1.0 and EXSLT extensions.[53]
The WebKit and Blink layout engines, used for example in the Safari and Chrome web browsers respectively, uses the libxslt library to do XSL transformations.[57]
Microsoft provides two XSLT processors (both XSLT 1.0 only). The earlier processor MSXML provides COM interfaces. From MSXML 4.0 it also includes the command line utility msxsl.exe.[65] The .NET runtime includes a separate built-in XSLT processor in its System.Xml.Xsl library.
Saxon is an XSLT 3.0 and XQuery 3.1 processor with open-source and proprietary versions for stand-alone operation and for Java, JavaScript and .NET. A separate product Saxon-JS[66] offers XSLT 3.0 processing on Node.js and in the browser.
Xalan is an open source XSLT 1.0 processor from the Apache Software Foundation available for Java and C++. A variant of the Xalan processor is included as the default XSLT processor in the standard Java distribution from Oracle.
Web browsers: Safari, Chrome (removal in progress), Firefox, Opera and Internet Explorer all support XSLT 1.0 (only).[67]
Muenchian grouping
Muenchian grouping (or Muenchian method, named after Steve Muench) is an algorithm for grouping of data used in XSL Transformations v1 that identifies keys in the results and then queries all nodes with that key. This improves the traditional alternative for grouping, whereby each node is checked against previous (or following) nodes to determine if the key is unique (if it is, this would indicate a new group).[68]
In both cases the key can take the form of an attribute, element, or computed value.
The unique identifier is referred to as a key because of the use of the 'key' function to identify and track the group variable.
The technique is not necessary in XSLT 2.0+, which introduces the new for-each-group tag.
The method took advantage of XSLT's ability to index documents using a key. The trick involves using the index to efficiently figure out the set of unique grouping keys and then using this set to process all nodes in the group:[69]
<xsl:keyname="products-by-category"match="product"use="@category"/><xsl:templatematch="/"><xsl:for-eachselect="//product[count(. | key('products-by-category', @category)[1]) = 1]"><xsl:variablename="current-grouping-key"select="@category"/><xsl:variablename="current-group"select="key('products-by-category', $current-grouping-key)"/><xsl:for-eachselect="$current-group"><!-- processing for elements in group --><!-- you can use xsl:sort here also, if necessary --></xsl:for-each></xsl:for-each></xsl:template>
Although the Muenchian method will continue to work in 2.0, for-each-group Is preferred as it is likely to be as efficient and probably more so. The Muenchian method can only be used for value-based grouping.
See also
XSLT elements – a list of some commonly used XSLT structures.
XSL formatting objects or XSL-FO – An XML-based language for documents, usually generated by transforming source documents with XSLT, consisting of objects used to create formatted output
Identity transform – a starting point for filter chains that add or remove data elements from XML trees in a transformation pipeline
Apache Cocoon – a Java-based framework for processing data with XSLT and other transformers.
Notes
↑XSL is often used ambiguously. XSL can refer to XSLT or XSL-FO. Only XSLT is a programming language and Lee said, "XSL is a programming language". He is using XSL to refer to XSLT. Further XSL-FO is an intermediate format for XSLT. Using XSL-FO means using XSLT too.
References
↑"Zvon XSLT Tutorial". zvon.org. Archived from the original on 23 Jan 2002. Retrieved 2026-08-02. The attribute version='1.0' specifies version of XSL(T) specification.
↑"XSLT – Tutorial, Tipps & Tricks | a coding project". www.a-coding-project.de (in German). Archived from the original on 9 Apr 2016. Retrieved 2026-08-02. Neben CSS ist XSL bzw. XSLT die zweite Möglichkeit um XML-Daten für den Browser relativ gut darstellbar zu machen. XSL(T) beschreibt dazu die Funktionen und den Syntax der es ermöglicht XML-Elemente in andere Elemente wie z.B. HTML umzuwandeln.
↑"SwissEduc - Informatik - Einführung in XML, DTD und XSL". www.swisseduc.ch (in German). Archived from the original on 17 Dec 2007. Retrieved 2026-08-02. Als Alternative kann ein so genannter XSL(T)-Prozessor benutzt werden. Beim XSL(T)-Prozessor handelt es sich um ein Werkzeug, das ebenfalls ein XSL Stylesheet und ein XML-Dokument entgegennimmt und daraus -- basierend auf den Anweisungen im Stylesheet -- ein neues Dokument erzeugt.
↑Cover, Robin. "Extensible Stylesheet Language (XSL)". xml.coverpages.org. Archived from the original on 2 Jun 2001. Retrieved 2026-08-02. [August 21, 2000] "Inside XSL-T." By Michael Classen. From WebReference.com (August 2000). ['XML may be all the buzz, but a lot of the heavy lifting is actually done with XSL. Extensible Style Sheet Language Transformation sounds like a mouthful, but XSLT is your key to converting XML documents into display languages like HTML.]' "XSL was initially devised to solve two problems: (1) Transforming an XML document into something else. (2) Formatting an XML document for display on a page-oriented device, such as a printer or a browser. Subsequently it has proven difficult to solve the second problem in a fashion that satisfies all the different requirements from low resolution screen displays all the way to hi-res printing and copying. Furthermore, screen formatting is currently done with Cascading Style Sheets (CSS), so little interest developed in yet another method. The World Wide Web Committee (W3C) then decided to split the two tasks into separate sub-standards, XSL Transformations (XSL-T) and XSL formatting objects (XSL-FO). While XSL-T has been an official recommendation since November of last year, XSL-FO is still in the making. A transformation expressed in XSLT describes rules for transforming a source tree into a result tree. The transformation is achieved by associating patterns with templates. Whenever a pattern matches elements in the source tree, a template is used to create part of the result tree. The result tree is separate from the source tree, and their structures can be completely different. In constructing the result tree, elements from the source tree can be filtered and reordered, and new elements can be added. A transformation expressed in XSLT is called a stylesheet in the case where XSLT is transforming into a display language, such as HTML or WML..."
↑Brockmeier, Joe (2025-08-27). "The tangled web of XSLT browser support". LWN.net. Retrieved 2026-07-28. Google has sought to drop support for XSLT a few times. In 2013, Adam Barth notified the Blink development list of an intent to deprecate and remove XSLT from the browser engine. Barth argued that the inclusion of XSLT added ""more than its share of complexity, which leads to security vulnerabilities"", and that dropping XSLT support would help to remove Blink's dependency on libxml. Ultimately, the proposal was put on hold. Dominic Cooney tried to deprecate and remove XSLT from Chrome in 2015. After much discussion, Rick Byers replied that Chrome's API owners had met and agreed that they would like to eliminate XSLT from Blink eventually. However, prior experience had taught the team that it was important to do so carefully and with a plan to ""minimize the user and developer pain"". Byers provided a list of components that such a plan would need to have, including real-world case studies for replacements and a deprecation timeline of up to two years. It is unclear if Cooney submitted such a plan, but a decade later Chrome still ships with libxslt and supports XSLT 1.0.
↑"SaxonJS". SaxonJS is a high-performance XSLT 3.0 processor that runs either in the browser, or on Node.js. It conforms with the latest W3C specifications (notably XSLT 3.0 and XPath 3.1), together with extensions designed to meet the needs of modern web applications.
↑"mfreed7 / xslt_polyfill". Github. The polyfill is powered by a WebAssembly port of the libxslt and libxml2 C libraries, providing a standards-compliant XSLT 1.0 engine.
↑"Introduction". XSL Transformations (XSLT) Version 1.0 W3C Recommendation. W3C. 16 November 1999. Retrieved November 7, 2012.
12"XSL Transformations (XSLT) Version 2.0". www.w3.org. Retrieved 2026-08-02. Existing XSLT 1.0 stylesheets are most often described using the unregistered media type "text/xsl".
↑Vazquez, Alexandre (2026-04-30). "XSL online tester: run XSL and XSLT transforms in your browser". Medium. Retrieved 2026-08-02. Both .xsl and .xslt are valid. The .xsl extension is older and more common in enterprise systems (SAP, Oracle, IBM DataPower). The .xslt extension is more explicit. Saxon accepts either. XSLT Playground accepts any content regardless of what you call it.
↑"Common XSLT Errors - XSLT | MDN". MDN Web Docs. 2025-11-13. Retrieved 2026-08-02. Your server needs to send both the source and the stylesheet with a XML mime type, text/xml or application/xml.
↑"XSLT Summary". www.ibm.com. Retrieved 2026-07-28. The XSLT syntax is hard to read, and rule-based programming is a concept alien to many programmers.
↑"XSLT Summary". www.ibm.com. Retrieved 2026-07-28. Processing XSLT stylesheets consumes considerable CPU resources. Scalable applications often require a cache for transformation results in order to achieve the necessary throughput. Another throughput-enhancing option is the use of an XSLT compiler, for example the XSLT compiler contained in XALAN, which translates an XSLT stylesheet into a set of Java classes.
↑"Why To Avoid XSLT". www.firstobject.com. 13 Jul 2005. Retrieved 2026-07-28. But the truth is that XSLT comes with overhead and architectural constraints that make for big headaches down the road. ... XSLT creates new performance issues that you might never encounter in more direct solutions.
↑"Why You Should Be Using XSLT 3.0". www.xml.com. February 14, 2017. Retrieved 2026-07-28. A problem that XSLT adoption has faced comes due to the difficulties in getting older implementations upgraded. Java ships with Xalan. Xalan has not been improved since it was first incorporated into Java back in 2000 and it still uses the very first version of XSLT, standardized in 1999. The Linux based libxslt processor is similar; while it is a good implementation for the Linux platform, it has not been upgraded since it was written in the early 2000s.
↑Kirkegaard, Christian; Møller, Anders; Schwartzbach, Michael I. (2003-05-06). "Static Analysis of XML Transformations in Java". BRICS Report Series (19). doi:10.7146/brics.v10i19.21789. ISSN1601-5355. Our approach We present a technique, Xact, that combines 1) a full integration of XML values and highly flexible operations for XML transformation into an existing high-level language, and 2) static guarantees of type safety of the transformations. We choose to build on Java since this language is already widely used in development of Web services. Using a general-purpose language allows mixing XML manipulations with other functionality, for example, accessing data bases or communicating on the Internet. [from page 7]
↑"Martin Fowler hates XSLT too". Coding Horror. 2005-07-05. Retrieved 2026-07-28. After working through a bit of the XSLT necessary to accomplish something, I concluded that it was easier and simpler to use procedural code to do the same thing.
↑Fowler, Martin (20 September 2003). "bliki: Moving Away From Xslt". martinfowler.com. Retrieved 2026-07-28. My conclusion from this exercise was that using Ruby for XML transforms was much easier than using XSLT.
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.
The XSLT Standard Library xsltsl, provides the XSLT developer with a set of XSLT templates for commonly used functions. These are implemented purely in XSLT, that is they do not use any extensions. xsltsl is a SourceForge project.
Kernow A GUI for Saxon that provides a point and click interface for running transforms.
You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.