XSLT 2.0 or 3.0 for Node.js?
Asked Answered
I

1

1

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!

Inestimable answered 25/7, 2017 at 17:7 Comment(0)
N
2

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.

Natalia answered 25/7, 2017 at 17:27 Comment(3)
Brilliant! Was just talking to the department director about Saxon, I'm glad that's a good alternative. Thanks for the heads up!Inestimable
We've had reports of people using Saxon-JS under Node.js but it's not actually something that Saxonica yet supports, though we would like to do so. In terms of features, we're aware that Saxon-JS is optimized for the browser environment (for example, it doesn't contain a serializer and relies on the browser for XML parsing). But feel free to see how far you get with it, and give us feedback.Whitewing
@MichaelKay: I'd forgotten about those limitations; thank you for being forthright in mentioning. Answer updated. My feedback would be to wish to see you continue the great work of building a world-class XSLT implementation in JavaScript by providing a parser and serializer without browser dependency. Even for in-browser applications, I would prefer to use your parser and serializer over that of the browser. (Yes, even at the cost of any increase in download size of the runtime library.)Natalia

© 2022 - 2024 — McMap. All rights reserved.