Search code examples
node.jsxmlxsltxslt-2.0

XSLT 2.0 or 3.0 for Node.js?


I've been looking for a node module that supports XML to HTML/XSL version 2.0 transformations via XSLT. I'm confined to developing in a windows environment, and have researched many alternatives including Saxon/C (saxon-node), node_xslt, gulp-xslt, and some others.

I haven't found a solution that satisfies our needs. Most solutions seem to require a linux or mac osx environment for development.

Any ideas? I greatly appreciate the help in advance!


Solution

  • 2020 update

    Saxon-JS 2 now supports XSLT 3.0 in Node.js and in the browser!


    Former answer

    Your best bet for XSLT in Node.js would be Saxon-JS, which is a XSLT 3.0 runtime in pure JavaScript1. Note that you'll need Saxon-EE, a commercial product, to compile your XSLT, but once that's done, you can freely deploy the result and the runtime. As a bonus, Saxon-JS implements not only XSLT 2.0 but XSLT 3.0 as well.

    1Caveat: Saxon-JS will clearly be your best bet once Saxonica adds support for parsing and serialization to the JavaScript runtime. Before then, these limitations will severely restrict the suitability of Saxon-JS to many projects, including possibly yours.