- From: Lemmin, Harald <Harald.Lemmin@softwareag.com>
- Date: Thu, 13 Dec 2001 10:10:44 +0100
- To: xmlschema-dev@w3.org
Hello, I'm confused about the attribute uses of complexType complexContent restriction: The primer states in "4.4 Deriving Complex Types by Restriction": "Notice that types derived by restriction must repeat all the components of the base type definition that are to be included in the derived type:" My question: Does this hold true for the attribute declarations, too? Example: <xs:complexType name="baseType"> <xs:attribute name = "att1" type = "xs:string" use = "optional"/> <xs:attribute name = "att2" type = "xs:string" use = "optional"/> <xs:attribute name = "att3" type = "xs:string" use = "optional"/> <xs:attribute name = "att4" type = "xs:string" use = "optional"/> </xs:complexType> <xs:complexType name="restrictedType"> <xs:complexContent> <xs:restriction base = "target:baseType"> <xs:attribute name = "att1" type = "xs:string" use = "required"/> <xs:attribute name = "att2" type = "xs:string" use = "prohibited"/> <xs:attribute name = "att3" type = "xs:string" use = "optional"/> </xs:restriction> </xs:complexContent> </xs:complexType> That means: att1 -> restricted by putting from optional to required. att2 -> restricted by putting from optional to prohibited. att3 -> mentioned again, because it should be still there. att4 -> not mentioned, because "restrictedType" should not have this attribute. Am I right? I know that the definition in the structures specification is more difficult, but I'm not able to understand it. Kind regards, Harald
Received on Thursday, 13 December 2001 04:10:49 UTC