What is XSL (eXtensible Stylesheet Language)?
XML stores data but says nothing about how it should look. XSL is the set of languages that bridges that gap, and it has three parts. XSLT, XSL Transformations, takes an XML document and transforms it into something else: an HTML page, a different XML format, plain text. XPath is the language XSLT uses to point at parts of the document, such as every product priced above a certain amount. XSL-FO, Formatting Objects, describes page layout for print and is mostly used to generate PDFs from XML.
XSLT 1.0 became a W3C recommendation in 1999 and has long been built into web browsers; versions 2.0 and 3.0 added far more power and run in dedicated processors such as Saxon. In publishing, finance, law and government, where large volumes of documents are stored as XML, XSLT pipelines turn a single source into a website, a printed book and an e-book.
Why it matters
Why XSL matters
For most website owners XSL is visible in one place: the XML sitemap. Open a sitemap in a browser and see a neat table of links instead of raw code, and an XSL stylesheet is doing that work, usually added by the SEO plugin that generates the sitemap. Beyond that, XSL matters wherever content lives in XML and has to appear in more than one form. It lets one structured source produce many outputs, which keeps them consistent and saves rewriting the same content for each channel, a principle that outlives any particular language.
In practice
How XSL works in practice
- 01
An XSLT stylesheet is a set of templates. Each template matches a part of the XML document, using XPath, and says what to output in its place: a table row for each entry in a sitemap, a heading for each chapter in a book, a list item for each product. A processor applies the stylesheet to the XML and writes the result. That can happen in the browser, on the server when a page is requested, or in a build step that produces the files ahead of time.
- 02
In web work today it is used selectively. Sitemap and feed stylesheets make XML files readable for people without changing what search engines and feed readers see. Server-side transformations convert feeds and data from partners into the formats a site needs. And because browser makers have announced plans to remove the XSLT support built into browsers, anything that depends on it should be treated as optional, with the transformations that matter run on the server or at build time.
Watch out
What people get wrong about XSL
Confusing it with CSS. Both are stylesheets, and CSS can style XML directly, but CSS only changes how elements look, while XSLT can restructure, sort, filter and generate new content. Second, thinking a styled sitemap affects search. Search engines read the raw XML and ignore the stylesheet entirely; it exists for human visitors. Third, building new features on XSLT in the browser, which ties a site to a capability browsers are moving away from.





