egh / xjslt

An XSLT 2.0 compiler (targeting JavaScript) written in TypeScript.
GNU Lesser General Public License v3.0
22 stars 3 forks source link
javascript xslt

XJSLT - An XSLT compiler in TypeScript

XJSLT is an XSLT 2.0 compiler (targeting JavaScript) written in TypeScript, depending on fontoxpath for an XPath implementation.

XJSLT works by compiling stylesheets to runnable JavaScript. These compiled stylesheets can be used immediately in the command line, or they can be save for later use in the command line. They can also be used programmatically either in the browser or in another JavaScript runtime.

Tested with node 20 and in Chrome and Firefox.

Getting started

Installation:

Command line invocation:

Compilation examples

XJSLT can compile XSLT stylesheets into executable JavaScript code, which can then be deployed to various platforms that support JavaScript, including the browser, NodeJS, and potentially other JavaScript runtimes. The following are some examples of how to do this for the browser, google cloud functions, and cloudflare edge functions. Note that this compiled .js may need to be recompiled if the xjslt version changes.

In the browser

For reuse in the command line

In a google cloud function

In a cloudflare edge function

Supported features

Incompletely supported features

TODO (not yet implemented)