给出以下文件
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的20091111与xercesImpl.jar在jing.jar相同的目录中。