给定以下文件
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在同一目录下的20091111的Jing和xercesImpl.jar。
发布于 2011-02-28 23:11:11
事实证明,Xerces不支持xml:id,这使得这成为可能。有关更详细的解释,请访问on the rng-users mailing list。
https://stackoverflow.com/questions/5126125
复制相似问题