Jirka, I will give XInclude a try.
As a follow-up, I looked at the link you gave to a post of James thinking about possible syntax for making nameClasses be patterns. I have a comment, which is that maybe the idea of making them full-fledged patterns is unnecessarily ambitious. I'm guessing that in 80%+ of use cases, the practical problem could be addressed simply by (1) allowing <externalRef> to wrap a nameClass definition. If in addition you (2) allow nameClasses to have names and (3) allow <parentRef> to refer to a named nameClass in the scope of the parent grammar, then you probably have covered 95%+ of use cases. This solution entails some "punning" on the meaning of <externalRef>, <parentRef> and of the meaning of a "name" attribute -- and if you didn't like that, you could instead create new syntactical elements, something like <externalNameClass> for (1) and <parentNameClassRef> for (2), etc. Point is, I don't think nameClasses necessarily need to treated totally like 100% full- fledged patterns -- just enough to support actual modular design use cases. John
