我在java中运行xslt转换时遇到了麻烦。我的xslt文件包含一些dyn:evaluate函数。
我的java代码是:
TransformerFactory factory = TransformerFactory.newInstance();
Source xslt = new StreamSource(new File(CONFIG + transformerFileName));
Transformer transformer = factory.newTransformer(xslt);
Source text = new StreamSource(new File(XML_SAMPLE_FILE));
transformer.transform(text, new StreamResult(new File(transformedFileName)));
当我运行它时,我收到以下错误:
ERROR: 'The first argument to the non-static Java function 'evaluate' is not a valid object reference.'
FATAL ERROR: 'Could not compile stylesheet'
似乎默认的java处理器不支持动态功能。我是否应该添加任何库以便在java中运行此xslt转换?
谢谢,
劳拉