Re: in XML schemas, can ALL groups be combined?

On Tue, 2005-01-25 at 10:42, Seeds, Glen wrote:
> 
> 
> The standard says:
> 
> Schema Component Constraint: All Group Limited
> When a model group has {compositor}
> <http://www.altova.com/specs_schema1.html>  all all of the following
> must be true:
> 1 one of the following must be true:
> 1.1 It appears as the model group of a model group definition.
> 1.2 It appears in a particle with {min occurs}
> <http://www.altova.com/specs_schema1.html> ={max occurs}
> <http://www.altova.com/specs_schema1.html> =1, and that particle must be
> part of a pair which constitutes the {content type}
> <http://www.altova.com/specs_schema1.html>  of a complex type
> definition.
> 2 The {max occurs} <http://www.altova.com/specs_schema1.html>  of all
> the particles in the {particles}
> <http://www.altova.com/specs_schema1.html>  of the group must be 0 or 1.
> 
> It's clear from this that you can't have more than one ALL model in a
> group. However, most validators interpret it to mean that you can not
> have have a group with more than one sub-group that are themselves
> internally based on an ALL model. 
> 
> This is bad, because it effectively destroys the re-usability of groups,
> voiding their whole reason for existence.
> 
> Is this interpretation correct? If so, what is the justification?

It is correct.

There was a good deal of resistance in the XML Schema
WG to including all-groups in XML Schema 1.0 in the first
place.  Allowing all-groups tends to complicate things; 
standard routines for working with regular languages 
don't deal well with all-groups and the naive translation 
of all-groups into standard regular expressions or automata 
are subject to combinatorial explosion.  SGML implementors
mostly found ways of dealing with the problems, but few
if any of those techniques have found their way into the
open literature.

The justification for including all groups in XML Schema 1.0,
although they are not present in XML 1.0 or 1.1 DTDs, was that
they were needed for simple straightforward tasks like dumping 
the columns of a relational table, and that allowing 
all-groups and other groups to nest within each other was
not necessary.  

I hope this helps.

-C. M. Sperberg-McQueen

Received on Tuesday, 25 January 2005 19:14:26 UTC