【问题标题】:Why isn’t Jing picking up xml:id for XInclude?为什么 Jing 不为 XInclude 获取 xml:id?
【发布时间】:2011-02-26 09:31:29
【问题描述】:

给定以下文件

a.rnc:

start = a
a = element a { b }
b = element b {
  attribute xml:id { xsd:ID }?,
  attribute xml:base { xsd:ID }?,
  empty
}

a.xml:

<a xmlns:xi="http://www.w3.org/2001/XInclude">
  <xi:include href="b.xml" xpointer="element(bid)"/>
</a>

b.xml:

<a><b xml:id="bid"/></a>

Jing为什么要报道

a.xml:1:97: warning: Include operation failed, reverting to fallback. Resource error reading file as XML (href='b.xml'). Reason: XPointer resolution unsuccessful.
a.xml:1:97: fatal: An 'include' failed, and no 'fallback' element was found.

当运行时

java -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration -jar jing.jar -c a.rnc a.xml

?

如果我将 xpointer 属性更改为 element(/1/1),它就会通过。

这是和jing.jar在同一个目录下的jing的20091111和xercesImpl.jar。

【问题讨论】:

    标签: xml relaxng xinclude jing


    【解决方案1】:

    事实证明,Xerces 不支持 xml:id 以使其成为可能。更详细的解释请见on the rng-users mailing list。

    【讨论】:

      猜你喜欢
      • 2011-09-23
      • 2011-10-12
      • 2021-12-09
      • 1970-01-01
      • 1970-01-01
      • 2021-12-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多