Re: [relax-ng-comment] An RNC modularisation strategy question

"MURATA Makoto (FAMILY Given)" <[email protected]> Tue, 20 Jul 2004 08:05:53 +0900
Newsgroups gmane.text.xml.relaxng.general
Message-ID <[email protected]>
On Mon, 19 Jul 2004 16:01:58 -0400
John Cowan <[email protected]> wrote:

> > The resultant schema (as I understand it) is illegal because M2 is
> > included twice.
> 
> Correct.  That's because inclusion is flat (it does not introduce a name
> scope); when you include rules, you throw away the enclosing grammar pattern
> (implicit in the case of rnc format).

You might want to use nested grammars for avoding conflicts.  For example:

start = foo
foo =
  grammar {
    start = foo
    foo = element foo { empty }
  }

In this schema, we have two definitions of "foo".  But the first  and 
the second belong to different grammars and thus they do not conflict.

Cheers,

Makoto

-- 
MURATA Makoto (FAMILY Given) <[email protected]>