Registry / devops / xjslt
library1.0.0jsnpmunverified

XJSLT is an XSLT 2.0 to JavaScript transpiler that compiles XSLT stylesheets into executable JavaScript code for Node.js or browser environments. Version 1.0.0, released as a stable first release, depends on fontoxpath for XPath evaluation. It claims faster performance than SaxonJS and supports most XSLT 2 features, though some edge cases and features like analyze-string and tunneled parameters are not yet implemented. It provides a CLI for compilation and transformation, and supports generating standalone scripts for cloud functions or browser use. Written in TypeScript with full type declarations, and requires Node.js >=18.

npm install xjslt
INSTALL
IMPORT
SIG · XJSLT
X
xjslt
devopsjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

compileStyleSheet
✓ import { compileStyleSheet } from 'xjslt'
✗ const { compileStyleSheet } = require('xjslt')
ESM-only; ship with TypeScript types
executeStyleSheet
✓ import { executeStyleSheet } from 'xjslt'
✗ const { executeStyleSheet } = require('xjslt')
ESM-only; type declarations included
XJsltOptions
✓ import type { XJsltOptions } from 'xjslt'
✗ import { XJsltOptions } from 'xjslt'
Type-only import for TypeScript

Compiles an XSLT stylesheet string and applies it to an XML string, outputting the transformation result.

import { compileStyleSheet, executeStyleSheet } from 'xjslt'; const xsltSource = `<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html><body><h1><xsl:value-of select="//title"/></h1></body></html> </xsl:template> </xsl:stylesheet>`; const xmlSource = `<?xml version="1.0" encoding="UTF-8"?> <root><title>Hello World</title></root>`; const compiled = compileStyleSheet(xsltSource); const result = executeStyleSheet(compiled, xmlSource); console.log(result);
Debug
Known issues
gotchaCompiled JavaScript may need recompilation if xjslt version changes.
fix
Recompile stylesheets after upgrading xjslt.
affects: >=1.0.0
breakingNode.js >=18 required; earlier versions unsupported.
fix
Update Node.js to version 18 or later.
affects: >=1.0.0
gotchaFeature 'analyze-string' not implemented (depends on xspattern.js).
fix
Use alternative XSLT constructs or wait for future release.
affects: >=1.0.0
gotchaTunneled parameters not supported.
fix
Use global parameters or xsl:with-param with direct binding.
affects: >=1.0.0
deprecatedOutput options not fully supported.
fix
Use default output behavior; custom output methods may not work.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'fontoxpath'
Missing fontoxpath dependency when using xjslt programmatically.
fix
npm install fontoxpath
TypeError: xjslt compile is not a function
Trying to use CLI function (like compile) from programmatic API.
fix
Use the exported compileStyleSheet and executeStyleSheet functions instead.
Error: Expected node >=18
Running on older Node.js version.
fix
Upgrade Node.js to version >=18.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
fontoxpathrequiredXPath implementation used at runtime
Agent activity
8 hits · last 30 days
node
6
Resources
packagexjslt ↗
xjslt — npm install xjslt · libregistry