RE: question about substitutionGroup tests

XSD 1.0 part 1 Section 3.3.2, mapping rules for Element Declaration Schema
Component 

{type definition}	--- The type definition corresponding to the
<simpleType> or <complexType> element information item in the [children], if
either is present, otherwise the type definition .resolved. to by the
.actual value. of the type [attribute], otherwise the {type definition} of
the element declaration .resolved. to by the .actual value. of the
substitutionGroup [attribute], if present, otherwise the .ur-type
definition..

So if the element has no explicit type, but is a member of the substitution
group of H, then the type defaults to the type of H, in which case the
constraint you refer to is automatically satisfied.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: public-xml-schema-testsuite-request@w3.org 
> [mailto:public-xml-schema-testsuite-request@w3.org] On Behalf 
> Of Tobias Koenig
> Sent: 12 November 2008 15:55
> To: public-xml-schema-testsuite@w3.org
> Subject: question about substitutionGroup tests
> 
> 
> test typeDef00204m has the following schema:
> 
> <xsd:schema
>   xmlns="ElemDecl/typeDef"
>   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>   targetNamespace="ElemDecl/typeDef">
> 
>   <xsd:element name="Head" type="xsd:boolean"/>
> 
>   <xsd:element name="root" substitutionGroup="Head"/>
> 
> </xsd:schema>
> 
> according to the meta data this schema is valid, however I 
> stumble about point 4 of Schema Component Constraint: Element 
> Declaration Properties Correct.
> 
> It says: the {type definition} of the element declaration 
> must be validly derived from the {type definition} of the 
> {substitution group affiliation}
> 
> So the type of 'root' element must be validly derived from 
> the type of 'Head'.
> But I can't see how xsd:AnyType (the default type for 
> element) can be derived from xsd:boolean...
> 
> Ciao,
> Tobias
> 

Received on Wednesday, 12 November 2008 16:10:53 UTC