pro-xslt is a browser-first XSLT 1.0 processor written in plain JavaScript—no native browser XSLT dependency required for the code paths it implements. You feed it source XML and a stylesheet document, and it builds the result tree in the page (for example via transformToFragment), with a predictable, growing feature set you control in JS.
Support for XSLT will be dropped as of October 2026. After trying polyfills that provide similar support using JavaScript libraries, I found them either too slow and/or too large in code size. I therefore decided to write my own version. The result is a “lightning-fast XSLT processor with no dependencies — only 28 KB”.
- Client-side transforms in modern browsers without shipping a full native stack everywhere.
- A compact footprint: production bundles are small—on the order of ~28 KB minified (9 KB gzipped), so it stays easy to embed in demos, tools, and extensions.
- Incremental XSLT 1.0 coverage: template matching,
xsl:value-of, conditionals,xsl:for-eachwith sorting, attribute sets, includes/imports, keys, decimal formatting, and more (see tests and source for the current surface).
The demo/ folder is a small lab to try transformations in the browser: edit XML and XSLT, run transforms, and compare Pro-XSLT with the browser’s native XSLT processor where available. After npm run build, open demo/index.htm locally, or use the GitHub Pages build from the main branch (see .github/workflows/deploy-pages.yml) for the hosted demo.
https://hbi99.github.io/pro-xslt/
- Node.js 22+ (development and tooling)
npm install pro-xsltFor local development of this repository:
npm install| Command | Description |
|---|---|
npm run build |
Build minified ESM and UMD bundles into dist/ |
npm run build:watch |
Rebuild bundles when source changes |
npm test |
Run the full Vitest suite once |
npm run test:watch |
Run Vitest in watch mode |
Use dist/pro-xslt.umd.js in the browser. The library is exposed as global ProXslt.
Import from dist/pro-xslt.esm.js or package entry exports.
src/— source codedist/— generated bundlesdemo/— interactive browser demo and testing UItests/— Vitest test suite and fixtures.github/workflows/— CI/CD, releases, and deployment automation
See CONTRIBUTING.md for contribution guidelines and development workflow.
GPL-3.0-only