Re: Restrictions on xs:all

"Michael Kay" <mhk@mhk.me.uk> writes:

> The rules make it pretty clear that you can't have an xs:sequence or
> xs:choice containing an xs:all, so the following is not allowed:
>
> <xs:sequence>
>   <xs:element ref="a"/>
>   <xs:all>
>     <xs:element ref="b"/>
>     <xs:element ref="c"/>
>   </xs:all>
> </xs:sequence>
>
> Is there a rule that bans the equivalent:
>
> <xs:sequence>
>   <xs:element ref="a"/>
>   <xs:group ref="g"/>
> </xs:sequence>
>
> <xs:group name="g">
>   <xs:all>
>     <xs:element ref="b"/>
>     <xs:element ref="c"/>
>   </xs:all>
> </xs:group>

The intention was that Schema Component Constraint: All Group Limited [1] 
would rule this out, but the wording wasn't as clear as it should have
been, so erratum E1-26 [2] was added to clarify this:

  Schema Component Constraint: All Group Limited

  When a model group has {compositor} all all of the following must be true:

  1. It appears only as the value of one or both of the following
     properties:

     1.1 the {model group} property of a model group definition.

     1.2 the {term} property of a particle with {max occurs}=1
         which is part of a pair which constitutes the {content type}
         of a complex type definition.

This rules out your second example above, and your subsequent question
about extension, since in neither case is 1.2 satisfied.

ht

[1] http://www.w3.org/TR/xmlschema-1/#cos-all-limited
[2] http://www.w3.org/2001/05/xmlschema-errata.html#e1-26
-- 
 Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                     Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
                   URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]

Received on Wednesday, 28 January 2004 06:36:17 UTC