<schema xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:structs="http://www.structs.com"
    targetNamespace="http://www.structs.com">
    
    <simpleType name="TestString">
	<restriction base="xsd:string">
	    <minLength value="2"/>
	    <maxLength value="23"/>
	    <whiteSpace value="collapse"/>
	</restriction>
    </simpleType>
    
    <simpleType name="Number1">
	<restriction base="xsd:decimal">
	    <maxExclusive value="99"/>
	    <minExclusive value="-99"/>
	</restriction>
    </simpleType>
    
    <simpleType name="Number2">
	<restriction base="tns:Number1">
	    <totalDigits value="5"/>
	    <fractionDigits value="3"/>
	</restriction>
    </simpleType>
    
    <simpleType name = "URLType">
	<restriction base = "NMTOKEN">
	    <enumeration value = "mailto"/>
	    <enumeration value = "http"/>
	    <enumeration value = "https"/>
	    <enumeration value = "ftp"/>
	    <enumeration value = "fax"/>
	    <enumeration value = "phone"/>
	    <enumeration value = "other"/>
	</restriction>
    </simpleType>
    
    <simpleType name="IntList">
	<list itemType="xsd:int"/>
    </simpleType>
    
    <simpleType name="UnionOfIntDateString">
	<union memberTypes="xsd:int xsd:date xsd:string"/>
    </simpleType>
    
    <xsd:element name="internationalPrice"> 
	<xsd:complexType> 
	    <xsd:simpleContent> 
		<xsd:extension base="xsd:decimal"> 
		    <xsd:attribute name="currency" type="tns:TestString" form="qualified" default="USD"/> 
		</xsd:extension> 
	    </xsd:simpleContent> 
	</xsd:complexType> 
    </xsd:element>

    <complexType name="Struct1">
	<all>
	    <element name="elem1" type="xsd:int" nillable="true"/>
	    <element name="elem2" type="tns:TestString" nillable="true"/>
	</all>
    </complexType>
    
    <complexType name="Struct2">
	<sequence>
	    <element name="elem1" type="xsd:int" nillable="true"/>
	    <element name="elem2" type="tns:TestString" nillable="true"/>
	</sequence>
    </complexType>
    
    <complexType name="Struct3">
	<complexContent>
	    <extension base="structs:Struct2">
		<sequence>
		    <element name="date1" type="xsd:date" default="01-01-01"/>
		    <element name="date2" type="xsd:date" fixed="02-02-02"/>
		    <element name="listelem" type="tns:IntList"/>
		    <element name="enumelem" type="tns:URLType"/>
		</sequence>
	    </extension>
	</complexContent>
	<attribute name="att1" type="xsd:date"/>
	<anyAttribute/>
    </complexType>
    
    <complexType name="Struct4">
	<all/>
	<attributeGroup ref="AttrGroup1"/>
    </complexType>
    
    <attributeGroup name="AttrGroup1">
	<attribute name="str1">
	    <simpleType>
		<restriction base="xsd:string">
		    <enumeration value="air"/>
		    <enumeration value="groung"/>
		    <enumeration value="any"/>
		</restriction>
	    </simpleType>
	</attribute>
	<attribute name="str2" type="xsd:string" use="prohibited"/>	    
	<attribute name="int1" type="xsd:int"/>
	<attribute name="int2" type="xsd:int" use="optional"/>
	<attribute name="cal1" type="xsd:dateTime"  use="required"/>
    </attributeGroup>

    <complexType name="Struct5">
	<choice>
    	    <group ref="PriceGroup"/>
	    <element name="USPrice" type="xsd:float"/>
	    <element name="UKPrice" type="xsd:double"/>
	    <element name="INDPrice" type="xsd:int"/>
	    <element name="ENGPrice" type="xsd:string"/>
	</choice>
    </complexType>

    <group name="PriceGroup">
	<sequence>
	    <element name="price" type="xsd:double"/>
	    <element name="currency" type="xsd:string"/>
	</sequence>
    </group>
</schema>