Creative agency glossaryWeb, UX/UI, and Design

XSL (eXtensible Stylesheet Language)

XSL (eXtensible Stylesheet Language) is a family of W3C languages for transforming and formatting XML documents, turning raw structured data into web pages, PDFs or other formats.

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

  1. 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.

  2. 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.

Questions

People also ask

What is the difference between XSL and XSLT?

XSL is the family name for the W3C's XML stylesheet languages. XSLT is the transformation language within it, and by far the most used part, so the two names are often used interchangeably. XSL-FO, the formatting part, is used mainly to generate PDFs.

Why does my XML sitemap look like a web page in the browser?

Because the plugin or platform that generates it has attached an XSL stylesheet, which the browser uses to display the XML as a readable table. Search engines ignore the stylesheet and read the underlying XML.

Is XSLT still used?

Yes, especially in publishing, finance, government and any field that stores documents as XML, where it turns one source into many formats. On the web its role is narrower, mainly styling sitemaps and feeds and transforming data on the server.

Next to it in the glossary

  1. Web AccessibilityWeb accessibility is the practice of designing and building websites so that people with disabilities, including visual, hearing, motor and cognitive disabilities, can perceive, use and understand them.
  2. Web DesignWeb design is the practice of planning and creating how a website looks, how it is organized and how it works for the people who use it, from layout and typography to navigation and interaction.
  3. Webflow DevelopmentWebflow development is building websites on Webflow, a visual platform that lets designers lay out a site on a canvas and generates production-ready code from what they draw.
  4. Website DevelopmentWebsite development is the full process of building a website, from planning and design through coding, content, testing and launch to the maintenance that keeps it running.
  5. WordPress DevelopmentWordPress development is the building of websites on the WordPress content management system, from custom themes and plugins to the hosting, performance and security that keep them running.
  6. XML (eXtensible Markup Language)XML (eXtensible Markup Language) is a text format for structuring data with custom tags, so that information can be stored and exchanged between systems in a form both people and machines can read.

Every Web, UX/UI, and Design term →

In the work

Where it shows up

All our creations →

From the journal

Read around it

The journal →

Talking the talk is one thing

We make the work.

RIOT is a creative agency and production studio in New York. Strategy, brand, film, photography, design and the campaigns that carry them, made by one team. A few lines is enough to start: we read every brief the same day.

    Footage