I don't think W3C XML Schema has any concept of multiple grammars. Thus, I
do not think RELAX NG is lacking anything in respect of inter-grammar
references as far as W3C XML Schema is concerned. What W3C XML Schema does
have but RELAX NG does not is that definitions within a grammar are
identified by a namespace URI/local name pair rather than a local name
alone. The easy way to facilitate translation from W3C XML Schema would to
allow define/ref to use QNames or an ns attribute just like
key/keyRef/element/attribute already can.
> Another problem is how to assemble necessary files. Say the "schema" A
> references a definition in B. The problem is, we cannot write
> <include href="B.rng"/> in A.rng because C.rng might have a reference to
> B, too.
>
> If both A and C has references to B and we write <include href="B.rng"/>
> to both A.rng and C.rng, then it causes a collision because B.rng is
> included twice.
>
> So converted RELAX NG files cannot contain <include> statements. Instead,
> you have to create a hub file by yourself and includes all necessary
> files, which is a very tiresome labor.
This is a fair point, but I don't think it's got much to do with
inter-grammar references. This problem crops up in many difference
programming languages.
One simple solution is to say that a grammar can have any number of
<include/> elements for a particular URI but the included grammar will only
get included once. Since we have order-independence this is safe. We
would have to require that the inherited value of the "ns" attribute was
the same for all includes of a particular URI.
James