在我的XSLT3.0中使用<axsl:mode on-no-match="shallow-copy"/>时,我得到了这个错误。lib --> saxon-ee:9.7.0.4
Error at /xsl:stylesheet/xsl:mode[1]
XTSE0010: Element xsl:mode must not appear directly within xsl:stylesheet
Error at /xsl:stylesheet/xsl:mode[1]
XTSE0010: Element xsl:mode must not appear directly within xsl:stylesheet
Error at /xsl:stylesheet/xsl:mode[1]
XTSE0010: Unknown XSLT element: mode当我使用最新的SaxonEE9-8-0-14时,我不确定如何使用Serializer. net.sf.saxon.s9api.Serializer
// destination
Serializer serializer = new Serializer(); // This worked with 9.7 but errors with 9.8
serializer.setOutputWriter(writer);
serializer.setOutputProperty(Serializer.Property.METHOD, "xml");
serializer.setOutputProperty(Serializer.Property.OMIT_XML_DECLARATION, "yes");
serializer.setOutputProperty(Serializer.Property.ENCODING, "UTF-8");
transformer.setDestination(serializer);请帮帮忙
发布于 2018-09-08 06:02:38
最新版本是Saxon 9.8。之前的9.7是在XSLT3.0推荐标准最终确定之前发布的,因此只有在明确请求的情况下(例如,通过在样式表上设置version=" 3.0“),XSLT3.0特性才可用。
为了使用工厂方法Processor.newSerializer(),Serializer的独立构造函数在9.6和9.7中被弃用,而公共构造函数最终在9.8中被删除。这是因为,除非Serializer能够访问支撑Processor的Configuration,否则它无法执行任何需要考虑配置设置的操作。
https://stackoverflow.com/questions/52228848
复制相似问题