{"id":42336,"library":"xjslt","title":"XJSLT","description":"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.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/egh/xjslt","tags":["javascript","xslt","xslt2","xslt3","xml","xpath","transform","typescript"],"install":[{"cmd":"npm install xjslt","lang":"bash","label":"npm"},{"cmd":"yarn add xjslt","lang":"bash","label":"yarn"},{"cmd":"pnpm add xjslt","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"XPath implementation used at runtime","package":"fontoxpath","optional":false}],"imports":[{"note":"ESM-only; ship with TypeScript types","wrong":"const { compileStyleSheet } = require('xjslt')","symbol":"compileStyleSheet","correct":"import { compileStyleSheet } from 'xjslt'"},{"note":"ESM-only; type declarations included","wrong":"const { executeStyleSheet } = require('xjslt')","symbol":"executeStyleSheet","correct":"import { executeStyleSheet } from 'xjslt'"},{"note":"Type-only import for TypeScript","wrong":"import { XJsltOptions } from 'xjslt'","symbol":"XJsltOptions","correct":"import type { XJsltOptions } from 'xjslt'"}],"quickstart":{"code":"import { compileStyleSheet, executeStyleSheet } from 'xjslt';\n\nconst xsltSource = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n  <xsl:template match=\"/\">\n    <html><body><h1><xsl:value-of select=\"//title\"/></h1></body></html>\n  </xsl:template>\n</xsl:stylesheet>`;\n\nconst xmlSource = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<root><title>Hello World</title></root>`;\n\nconst compiled = compileStyleSheet(xsltSource);\nconst result = executeStyleSheet(compiled, xmlSource);\nconsole.log(result);","lang":"typescript","description":"Compiles an XSLT stylesheet string and applies it to an XML string, outputting the transformation result."},"warnings":[{"fix":"Recompile stylesheets after upgrading xjslt.","message":"Compiled JavaScript may need recompilation if xjslt version changes.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Update Node.js to version 18 or later.","message":"Node.js >=18 required; earlier versions unsupported.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use alternative XSLT constructs or wait for future release.","message":"Feature 'analyze-string' not implemented (depends on xspattern.js).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use global parameters or xsl:with-param with direct binding.","message":"Tunneled parameters not supported.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use default output behavior; custom output methods may not work.","message":"Output options not fully supported.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.0':24 '18':95 '2':47 '2.0':6 'analyz':57 'analyze-str':56 'browser':21,83 'case':52 'claim':38 'cli':69 'cloud':80 'code':17 'compil':11,71 'declar':91 'depend':31 'edg':51 'environ':22 'evalu':36 'execut':15 'faster':39 'featur':48,54 'first':29 'fontoxpath':33 'full':89 'function':81 'generat':76 'implement':65 'javascript':8,16,96 'like':55 'node.js':19,94 'paramet':61 'perform':40 'provid':67 'releas':25,30 'requir':93 'saxonj':42 'script':78 'stabl':28 'standalon':77 'string':58 'stylesheet':13 'support':44,75 'though':49 'transform':73,102 'transpil':9 'tunnel':60 'type':90 'typescript':87,103 'use':84 'version':23 'written':85 'xjslt':1,2 'xml':100 'xpath':35,101 'xslt':5,12,46,97 'xslt2':98 'xslt3':99 'yet':64","created_at":"2026-06-04T18:56:46.046003+00:00","updated_at":"2026-06-04T18:56:46.046003+00:00","problems":[{"fix":"npm install fontoxpath","cause":"Missing fontoxpath dependency when using xjslt programmatically.","error":"Error: Cannot find module 'fontoxpath'"},{"fix":"Use the exported compileStyleSheet and executeStyleSheet functions instead.","cause":"Trying to use CLI function (like compile) from programmatic API.","error":"TypeError: xjslt compile is not a function"},{"fix":"Upgrade Node.js to version >=18.","cause":"Running on older Node.js version.","error":"Error: Expected node >=18"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/egh/xjslt","github":"ssh://git@github.com/egh/xjslt","docs":null,"changelog":null,"pypi":null,"npm":"xjslt","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}