Why isn’t Jing picking up xml:id for XInclude?

679 views Asked by At

Given the following files

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>

Why is Jing reporting

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.

when run as

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

?

If I change the xpointer attribute to element(/1/1) it passes.

This is with the 20091111 of Jing with xercesImpl.jar in the same directory as jing.jar.

1

There are 1 answers

0
user322381 On BEST ANSWER

It turns out that Xerces doesn’t support xml:id in a way that makes this possible. A more detailed explanation is available on the rng-users mailing list.