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

MURATA Makoto (FAMILY Given) EB2M-MRT at asahi-net.or.jp
Mon Jul 19 23:06:36 ICT 2004


On Mon, 19 Jul 2004 16:01:58 -0400
John Cowan <jcowan at reutershealth.com> 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) <EB2M-MRT at asahi-net.or.jp>




More information about the relaxng-user mailing list