[relaxng-user] Re: Jing and libxml2 is right, Trang is wrong

Eric van der Vlist vdv at dyomedea.com
Sat Mar 6 09:56:41 ICT 2004


On Sat, 2004-03-06 at 09:12, David Tolpin wrote:

> 2) I tend to disagree with James. Either implicit grouping is not
> allowed anywhere, or it is consistently allowed; 
> 
> start = foo,bar
> 
> is perfectly correct and normally used in nested grammars. Nested
> grammars are very useful in conjunction with parentRef elements.
> 
> Trying to fix a hypothetic bug James introduced a real one.

I have been surprised by this limitation too and that's why I had asked
the question. My "natural" expectation was that the content model of
<start/> would be coherent with the content model of <define/> since
these two patterns are really very similar in behaviour.

> 3) In cases where 
> 
> start = foo, bar 
> 
> is a bug,
> 
> <start>
>   <ref name="foo"/>
>   <ref name="bar"/>
> </start>
> 
> does not have a chance to be misused as it were a choice, because
> this pattern is forbidden in top-level grammars.
> 
> Cases where
> 
> start = foo, bar
> 
> is correct is used in nested grammars; and in most cases nested
> grammars are used by people who know what they are doing.
> 
> I think this artificial limitation should be lifted.

That would be my feeling too, but it's really difficult to tell what's
the least confusing...

Misusing and implicit <group/> for a <choice/> would leave to schemas
that would be valid but behave in an unexpected manner (for the author
who would have made the error) while this restriction raises a schema
error which cannot be ignored and that can be considered safer.

Eric
-- 
Have you ever thought about unit testing XSLT templates?
                                                     http://xsltunit.org
Upcoming XML schema languages tutorial:
 - Santa Clara  -half day- (15/03/2004)        http://masl.to/?J24916E96
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------



More information about the relaxng-user mailing list