Migrate off native XSLT

Chrome 158 stops running XSLT on 17 November 2026. Answer three questions and the steps below show only what your project needs. Each step is one command or one line. The how-to explains why each one works.

Where does your project use XSLT in the browser?
Which XSLT version are the stylesheets?
How is the JavaScript built?
  1. Scan

    Find every page that depends on the browser's XSLT. Nothing leaves your machine.

    npx xslt-migrate-check .

    It rates each finding, says what to install, and with --html writes a report you can send to a client. No Node.js at hand? Check your files online: they are read in your browser, nothing is uploaded. The checker reference lists what it looks for.

  2. Install

    npm install @tradik/xslt-processor

    Or yarn add, pnpm add, bun add with the same package name.

    npm install @tradik/xslt-processor @tradik/xslt3

    The browser never ran XSLT 2.0 or 3.0; @tradik/xslt3 does, and @tradik/xslt-processor hands it those stylesheets.

    Plain XML files load the library from the CDN in the next step; installing is optional.

  3. Add one line

    First in your entry module, before code that uses XSLTProcessor:

    import "@tradik/xslt-processor/polyfill";

    Before your own scripts:

    <script src="https://cdn.jsdelivr.net/npm/@tradik/xslt-processor@1/dist/xslt-processor.browser.min.js"></script>

    In each XML file, right after <?xml-stylesheet … ?>, inside the root element:

    <script xmlns="http://www.w3.org/1999/xhtml" src="https://cdn.jsdelivr.net/npm/@tradik/xslt-processor@1/dist/xslt-processor.browser.min.js"></script>

    Create processors with new XSLTProcessor({ xsltVersion: "auto" }): each stylesheet runs on the engine its version asks for. An XML file whose stylesheet is 2.0 or 3.0 is better rendered on the server (step 5).

    Or let the checker write the change as a patch to review: npx xslt-migrate-check . --fix writes migration.patch.

  4. Test

    Run every stylesheet on the browser's engine and on this library and compare the output:

    npx -p xslt-migrate-check -p @tradik/xslt-processor -p jsdom xslt-migrate-test .

    Then open the pages in Chrome with XSLT switched off, which is what Chrome 158 ships:

    chrome --disable-blink-features=XSLT
  5. Deploy

    Ship it, and keep it fixed: a pipeline step fails the build when a page without the migration appears.

    npx xslt-migrate-check . --fail-on high

    Pages that are the same for every visitor need no XSLT in the browser at all: xslt page.xml page.xsl -o page.html with the command line tool.