- From: Joey Coyle <joey@xcoyle.com>
- Date: Mon, 11 Mar 2002 17:05:55 -0500 (EST)
- To: xmlschema-dev@w3.org
Is this valid, I basically have a type which contains a sequence of itself. Then I define two restrictions, Blue and Green, and then comes my question.... called MyQuestionBase, can I substitute the unbounded "item" element with just two subclasses Blue and Green. This seems like substitution groups, but they are not global elements, they are global complex types that I am substituting for "item" in the restriction. This validates OK, but I don't really trust if it is valid????? Please help joey coyle <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:complexType name="Base"> <xs:sequence> <xs:element name="item" type="Base" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:complexType name="BlueBase"> <xs:complexContent> <xs:restriction base="Base"> <xs:sequence> <xs:element name="item" type="Base" maxOccurs="unbounded"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="GreenBase"> <xs:complexContent> <xs:restriction base="Base"> <xs:sequence> <xs:element name="item" type="Base" maxOccurs="unbounded"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="MyQuestionBase"> <xs:complexContent> <xs:restriction base="Base"> <xs:sequence> <xs:element name="blue" type="BlueBase"/> <xs:element name="green" type="GreenBase"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> </xs:schema>
Received on Tuesday, 12 March 2002 04:25:13 UTC