首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >元素xsl:mode不能直接出现在xsl:stylesheet中

元素xsl:mode不能直接出现在xsl:stylesheet中
EN

Stack Overflow用户
提问于 2018-09-08 03:51:54
回答 1查看 622关注 0票数 1

在我的XSLT3.0中使用<axsl:mode on-no-match="shallow-copy"/>时,我得到了这个错误。lib --> saxon-ee:9.7.0.4

代码语言:javascript
复制
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

代码语言:javascript
复制
// 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);

请帮帮忙

EN

回答 1

Stack Overflow用户

发布于 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能够访问支撑ProcessorConfiguration,否则它无法执行任何需要考虑配置设置的操作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52228848

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档