Altova Mailing List Archives
>xmlschema-dev Archive Home
>Thread Prev - Re: Ignore Order while validating XSD
>Thread Next - Re: restriction against base type (choice - elt)
restriction against base type (choice - elt)
Date: 1/27/2009 4:22:00 PM
Hi.. According to specification the following schema is invalid since according to the table in http://www.w3.org/TR/xmlschema-1/#cos-particle-restrict it is given that the case "choice (Derived particle) to element(Base Particle) is Forbidden" <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="head"/> <xs:element name="m1" substitutionGroup="head"/> <xs:element name="m2" substitutionGroup="head"/> <xs:complexType name="base"> <xs:sequence> <xs:element ref="head"/> </xs:sequence> </xs:complexType> <xs:complexType name="derived"> <xs:complexContent> <xs:restriction base="base"> <xs:sequence> <xs:choice> <xs:element ref="m1"/> <xs:element ref="m2"/> </xs:choice> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> </xs:schema> Can anybody please tell me whether the above schema is valid or invalid against the schema spec. Thanks and Regards, Bharath.