带有XSLT 2.0的Java的Apache FOP ...? [英] Apache FOP from Java with XSLT 2.0…?

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

问题描述

在Apache FOP 1.0的嵌入式使用中使用XSLT 2.0的某些功能时遇到问题.特别是在使用"current-group()"时出现异常.

I'm having problems using some of the features of XSLT 2.0 in an embedded use of Apache FOP 1.0. In particular I get an exception when using "current-group()".

我看到FOP使用的是xalan 2.6,这引发了异常.

I see that FOP is using xalan 2.6 which is throwing the exception.

我试图排除xalan 2.6的传递依赖,并用2.7.1替换了它,但是它没有帮助.可以将Apache FOP与支持更多2.0功能的另一个XSLT处理器一起使用吗?

I tried to exclude the transitive dependency of xalan 2.6 and replaced it with 2.7.1 but it didn't help. Is it possible to use Apache FOP with another XSLT processor that supports more 2.0 features?

推荐答案

如果从命令行将FOP作为独立发行版运行,则可以

  1. 使用XSLT处理器复制所需的jar文件(例如 saxon9he.jar)到FOP发行版的lib目录.

  1. copy the required jar file(s) with the XSLT processor (like e.g. saxon9he.jar) to the lib directory of your FOP distribution.

并通过添加来指定FOP要使用的处理器实现 像这样的VM参数 -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl (以Saxon为例)到启动脚本(在Linux上为fop,在 Windows)位于调用org.apache.fop.cli.Main的行.

and specify the processor implementation to be used by FOP by adding a VM parameter like this -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl (example for Saxon) to the start script (fop on Linux, fop.bat on Windows) at the line where org.apache.fop.cli.Main is called.

如果您将FOP嵌入Java代码中,只需使用该VM参数启动应用程序(并确保所需的jar文件位于您的CLASSPATH中).

If you embed FOP in your Java code, simply start your application with that VM parameter (and make sure the required jar files are in your CLASSPATH).

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

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