Node.js 是 XSLT 2.0 还是 3.0? [英] XSLT 2.0 or 3.0 for Node.js?

查看:22
本文介绍了Node.js 是 XSLT 2.0 还是 3.0?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找通过 XSLT 支持 XML 到 HTML/XSL 2.0 版转换的节点模块.我仅限于在 windows 环境中进行开发,并研究了许多替代方案,包括 Saxon/C (saxon-node)、node_xslt、gulp-xslt 和其他一些.

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.

我还没有找到满足我们需求的解决方案.大多数解决方案似乎都需要 linux 或 mac osx 环境进行开发.

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!

推荐答案

2020 更新

Saxon-JS 2 现在 在 Node.js 和浏览器中支持 XSLT 3.0

以前的答案:在 Node.js 中使用 XSLT 的最佳选择是 Saxon-JS,它是纯 JavaScript1 中的 XSLT 3.0 运行时.请注意,您需要 Saxon-EE,一种商业产品,用于编译您的 XSLT,但是一旦完成,您就可以自由部署结果和运行时.作为奖励,Saxon-JS 不仅实现了 XSLT 2.0,还实现了 XSLT 3.0.

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.

1警告:一旦 Saxonica 为 JavaScript 运行时添加对解析和序列化的支持,Saxon-JS 显然是您最好的选择.在此之前,这些限制将严重限制 Saxon-JS 对许多项目的适用性,可能包括您的项目.

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.

这篇关于Node.js 是 XSLT 2.0 还是 3.0?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆