I hope somebody can help me. In a big RNG project that contains many files, I 
repeatedly 
use a particular name-class in various places throughout the project. (It's the 
name class 
of all names that are not in any of the namespaces used by my project, i.e. the 
foreign 
name class with respect to my project's namespaces.)

<anyName>
  <except>
    <nsName ns="http://myproject.org/ns1/"/>
    <nsName ns="http://myproject.org/ns2/"/>
    <nsName ns="http://myproject.org/ns3/"/>
  </except>
</anyName>

Because it's used in lots of places, I'd like to factor the name-class 
declaration out into a 
separate file and reference the name class declaration in the locations where 
it appears in 
my files, so if my namespaces change, I can maintain them in one place.

The problem is, in RNG a name-class is not a pattern. So to factor it out into 
an 
<externalRef> does not seem to be possible, since <externalRef/> requires the 
contents 
of the referenced file to be a valid pattern.

Nor can I seem to use <include> to insert a reference to this fragment, because 
a name-
class can't be the immediate child of a <define> or <grammar> element, for the 
same 
reason as above.

So in RNG, is there a clever way to factor out name-class declarations into a 
separate file 
and reference them as externals in some way?

Or am I missing the boat entirely here?

John

Reply via email to