[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: Re: [relax-ng] Limitation in the compact syntax
> While trying to translate Makoto's ooRelaxNG examples into the > compact syntax, I bumped up against a problem: once inside an > annotation, you can only use annotation syntax. This doesn't work > well for things like ooRelaxNG, where the os:class element can contain > snippets of RELAX NG. ooRelaxNG isn't RELAX NG. It is a distinct vocabulary, having a lot of similarity to RELAX NG, which can be easily translated into RELAX NG. The os:class element is not a RELAX NG annotation, rather it's a first-class member of the ooRelaxNG vocabulary, just like os:element (note that it's os:element not rng:element). This seems out of scope to me: the goal of the compact syntax is to be a syntax for RELAX NG. If you want a nice compact syntax for ooRelaxNG, then I think the way to do it is to take an analagous approach to the approach Makoto took with the XML syntax. Design an extended language in which OO constructs are first-class syntactic constructs, not annotations. Makoto's example might look something like this: abstract class animal { } abstract class mammal extends animal { } class cat extends mammal { attribute color { text }? } class fortuneCat extends cat { attribute raisedPaw { ## inviting money "left" | ## inviting people "right" } } start = element schemaLanguage { element mascot { class animal }, element specifications { list { "string"* } } } } Yes, this is a lot more work than trying to fake it up with the compact syntax and annotations. This is one area where XML wins: XML tools make this a lot easier to do in an XML syntax than in a non-XML syntax. James
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC