xslt 2.0 and Ruby on OS X

蹲街弑〆低调 提交于 2019-12-04 13:10:14

Sadly, Saxon is the only game in town with a free XSLT 2.0 implementation. Saxon itself is brilliant, but it is Java or .NET only, with all that that implies.

Invoking it from the command line or via a system call will incur a JVM startup cost every time, so you probably don't want to do that.

Some things you can try:

1) Are you sure you need XSLT 2.0? Unless you're using functionality that isn't in 1.0, your XSLT might be 1.0-compatible. Then you could use xsltproc. If what you need is in EXSLT, xsltproc has some support for that.

2) If you definitely need 2.0, then you'll want to create some sort of wrapper for saxon. A lot depends on what environment you want to use this in, so this might be a web service or something like that. For a project I work on, we use a little TCP listener program that wraps saxon. You can see it here: http://idp.atlantides.org/svn/idp/idp.contenttool/trunk/epiduke_saxon/ It works well for command-line batch transforms, and is very fast.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!