- From: Andrey V. Chernyakhovsky <achp@bk.ru>
- Date: Thu, 05 Jun 2003 22:24:55 -0600
- To: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>
I believe, http://www.w3.org/TR/xmlschema-1/#rcase-NameAndTypeOK clause 1 is too restrictive: 1 The declarations' {name}s and {target namespace}s are the same. Consider an example: <xs:complexType name="B"> <xs:sequence> <xs:element name="contents" type="xs:anyType" minOccurs="0" maxOccurs="5"/> </xs:sequence> </xs:complexType> <xs:element name="B" type="B"/> <xs:complexType name="D"> <xs:complexContent> <xs:restriction base="B"> <xs:sequence> <xs:element name="contents" type="xs:anyType" minOccurs="0" maxOccurs="3"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="D" type="D" substitutionGroup="B"/> <xs:complexType name="b"> <xs:sequence> <xs:element ref="B"/> </xs:sequence> </xs:complexType> <xs:complexType name="r"> <xs:complexContent> <xs:restriction base="b"> <xs:sequence> <xs:element ref="D"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> The type "r" is not a valid restriction of the type "b" as clause 1 is violated - there is an element "D", instead of "B". However, "D" is an element within the substitution group for "B"; "b" will validate any of them. A type that would validate only "D" could be called a restriction of "b", in the sense that any instance valid as per that type should be valid as per "b" (but the opposite is not true). I think, clause 1 should be rewritten to allow such restrictions: 1 One of the following must be true: 1.1 The declarations' {name}s and {target namespace}s are the same. 1.2 R is in the substitution group of B.
Received on Friday, 6 June 2003 00:29:39 UTC