XJSLT is an XSLT 2.0 compiler (targeting JavaScript) written in TypeScript, depending on fontoxpath for an XPath implementation.
XJSLT compiles stylesheets to runnable JavaScript, so you can create transforms for use in a browser.
Tested with node 20 and (less extensively) in Chrome and Firefox.
npm install && npm run build
xjslt test/simple2.xslt test/simple.xml
xjslt compile jats-html.xsl
(will generate atransform.js
file)- Open
example.html
(will load the generatedtransform.js
file)
-
1985 passing tests in the XSLT test suite (https://github.com/w3c/xslt30-test)
-
2419 not passing
-
if
/choose/when/otherwise
- conditional evaluation -
template
-
apply-templates
/for-each
- recursive evaluation -
element
/attribute
/value-of
- dynamic elements, attributes, and text -
literal text and xml element output
-
variable
-
namespaces
-
sort
-
include
-
result-document
for-each-group
(onlygroup-by
supported)import
(precedence not supported)function
basically work, with better typing TBD
-
strip-space
/preserve-space
-
output
-
attribute-set
- … (probably other things I’m not aware of or forgot)