Re: Schema error or validation bug ?

Guillaume Rousse writes:

[why does xerces complain about this]

> <complexType name="fooType">
>   <complexContent>
>     <extension base="model:barType">
>       <all>
>         <element name="elmt1" type="string"/>
>       </all>
>     </extension>
>   </complexContent>
> </complexType>
> 
> <complexType name="barType">
>   <complexContent>
>     <extension base="model:fooType">
>       <all>
>         <element name="elmt2" type="string"/>
>         <element name="elmt3" type="string"/>
>       </all>
>     </extension>
>   </complexContent>
> </complexType>
> 
> [Error] file.xml:6:4: Schema error: ComplexType 'barType': 
> cos-all-limited.1.2:  An "all" model group that is part of a complex type 
> definition must constitute the entire {content type} of the definition.

The complaint is correct -- the effective content model you are asking 
for is

 <seq><all>...</all><all>...</all></seq>

which is not allowed.  Noah's answer (below) explains why -- the
_result_ of extension must validate content which contains valid
instances of the base type definition at the beginning.  So just as the
effect of extending a choice with a choice is _not_ a bigger choice,
but two choices in a row, the effect of trying to extend an all with
an all is two alls in a row, which is not allowed.

Noah_Mendelsohn@lotus.com writes:

> As far as I know, it's an error.  Extension is currently defined to (1) 
> add attributes and/or (2) extend using sequences.  So, extension of all 
> groups is not supported.  The pertinent restriction in the specification 
> is [1], which says:
> 
> "[Definition:]  For a particle (call it E, for extension) to be a valid 
> extension of another particle (call it B, for base) one of the following 
> must be true:
> 1 They are the same particle. 
> 2 E's {min occurs}={max occurs}=1 and its {term} is a sequence group whose 
> {particles}' first member is a particle all of whose properties, 
> recursively, are identical to those of B, with the exception of 
> {annotation} properties. "
> 
> Note that it calls for sequence groups.
> 
> 
> Does it means inheriting type with unordered elements is illegal, or is it 
> a 
> xerces bug ?
> -- 
> Guillaume Rousse <rousse@ccr.jussieu.fr>
> GPG key http://bohm.snv.jussieu.fr/~rousse/gpgkey.html
> 
> 
> 
> 
> 
Noah'
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Thursday, 30 August 2001 06:16:47 UTC