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.
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
--htmlwrites 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.Install
npm install @tradik/xslt-processorOr
yarn add,pnpm add,bun addwith the same package name.npm install @tradik/xslt-processor @tradik/xslt3The browser never ran XSLT 2.0 or 3.0;
@tradik/xslt3does, and@tradik/xslt-processorhands it those stylesheets.Plain XML files load the library from the CDN in the next step; installing is optional.
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 itsversionasks 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 . --fixwritesmigration.patch.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=XSLTDeploy
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 highPages that are the same for every visitor need no XSLT in the browser at all:
xslt page.xml page.xsl -o page.htmlwith the command line tool.