[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: Re: [relax-ng] Control of the combinations of patterns
On Fri, 2003-01-03 at 12:32, James Clark wrote: > > > I allow grammars which will include this one to combine this definition > > by choice or interleave while if I write: > > > > foo = &bar > > > > I forbid combinations by choice and if I write > > > > foo = |bar > > > > I forbid combinations by interleave. > > This doesn't seem very useful to me. If you forbid this, then I can instead > completely override the definitions instead of using combine. In the > context of RELAX NG, this sort of thing is at most a hint to users that want > to customize a schema, Yes, exactly. And in any case, even with the strictest mechanism you can't prevent people to edit a local copy of the schema or to use another schema :-) ... > and, as such, I think some conventional annotation > attributes would be enough: eg an annotation attribute on a define that says > whether is/is not intended to be combined with choice/interleave. Agreed. You can then be more specific in which redefinitions should be avoided to be compatible with such and such application. > > Questions: > > - would it be useful to be able to forbid both (similar to the notion > > of "final" definition)? > > - would it be usefull to impose that a combination is applied (notion of > > "abstract" definition)? > > You can get something very similar to an abstract definition by using > notAllowed. For example, in the original schema use: > > a = notAllowed > > Then in the overriding schema use: > > a |= element .... This is similar but works only in the case where you don't provide any original content for the named pattern "a", not if you want to define a content which must be combined with something else. Thanks Eric -- Freelance consulting and training. http://dyomedea.com/english/ ------------------------------------------------------------------------ Eric van der Vlist http://xmlfr.org http://dyomedea.com (W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema ------------------------------------------------------------------------
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC