首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Eric van der Vlist的RelaxNG简化的局限性

Eric van der Vlist的RelaxNG简化的局限性
EN

Stack Overflow用户
提问于 2011-02-24 16:48:53
回答 2查看 242关注 0票数 1

全,

我正在尝试使用Eric van der Vlist's simplification.xsl来简化RelaxNG模式,但遇到了错误:

代码语言:javascript
复制
runtime error: file ./simplification.xsl line 741 element element
xsl:element: The effective name '' is not a valid QName.
runtime error: file ./simplification.xsl line 751 element element
xsl:element: The effective name '' is not a valid QName.
runtime error: file ./simplification.xsl line 759 element element
xsl:element: The effective name '' is not a valid QName.
runtime error: file ./simplification.xsl line 759 element element
xsl:element: The effective name '' is not a valid QName.
runtime error: file ./simplification.xsl line 759 element element
xsl:element: The effective name '' is not a valid QName.

这似乎与一些动态构造的名称有关:

代码语言:javascript
复制
<xsl:template match="rng:start[not(preceding-sibling::rng:start) and following-sibling::rng:start]" mode="step7.18">
        <xsl:copy>
                <xsl:apply-templates select="@*" mode="step7.18"/>
                <xsl:element name="{parent::*/rng:start/@combine}">
                        <xsl:call-template name="start7.18"/>
                </xsl:element>
        </xsl:copy>
</xsl:template>

我还没有开始更深入地研究它,但也许有人已经对可能导致这种情况的原因有了线索。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-02-25 05:57:20

显然,我不是第一个遇到这些问题的人。This web site还提到了一些运行simplification.xsl的问题,并包含了一些修复。我只是把它复制到这里,以备将来参考。

第10步中的

  • :行组合中缺少前缀"rng:“,导致输出中具有默认命名空间(不是RelaxNG)的标记<xsl:with-param name="node-name" select="'rng:group'"/>。第14步中的
    • :在行<xsl:with-param name="node-name" select="'rng:group'"/>中的"combine”属性值之前添加前缀"rng:“的串联步骤14 :在模板<xsl:template match="rng:start[not(preceding-sibling::rng:start) and following-sibling::rng:start]">中,我删除了元素add <xsl:element name="{parent::*/rng:start/@combine}">,因为它会导致在<rng:start>.
    • In中的其他<<xsl:element name="{parent::*/rng:start/@combine}">>d15<rng:choice> >周围出现额外的<rng:choice>第15步:似乎该模板<xsl:template match="/*">比模板<xsl:template match="/rng:grammar">具有更高的优先级,所以我必须添加一个precision:<xsl:template match="/*[not(self::rng:grammar)]">.
    • In为了保持在<parentRef>.

    的“"rng:parentRef/@name"”属性中生成的id,我必须添加一个精度:<xsl:template match="/*[not(self::rng:grammar)]">.

  • In第15步:在擦除模板中缺少模板:<xsl:template match="rng:define|rng:define/@name|rng:ref/@name|rng:parentRef/@name"/>

在给定网站中复制我的原始RelaxNG语法之后,整个转换就完成了,没有任何问题。

票数 1
EN

Stack Overflow用户

发布于 2011-03-02 03:18:31

有没有什么理由不使用jing -s呢?

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

https://stackoverflow.com/questions/5102313

复制
相关文章

相似问题

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