<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:this="www.example.org/simpletype/ref"
 targetNamespace="www.example.org/simpletype/ref">

<xsd:element name="SomeType" type="this:SomeType_type"/>

<xsd:complexType name="SomeType_type">
	<xsd:complexContent>
		<xsd:restriction base="this:Type_type">
			<xsd:sequence>
				<xsd:element name="something" type="xsd:string"/>
			</xsd:sequence>
		</xsd:restriction>
	</xsd:complexContent>
</xsd:complexType>

<xsd:element name="Type" type="this:Type_type"/>

<xsd:complexType name="Type_type">
	<xsd:sequence>
		<xsd:element name="something" type="xsd:string" minOccurs="0" />
	</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="OtherType">
	<xsd:sequence>
		<xsd:element name="billingAccountNumber">
			<xsd:complexType>
				<xsd:complexContent>
					<xsd:extension base="this:SomeType_type"/>
				</xsd:complexContent>
			</xsd:complexType>
		</xsd:element>
		<xsd:element name="installmentPlanId">
			<xsd:simpleType>
				<xsd:restriction base="xsd:long">
					<xsd:totalDigits value="5"/>
				</xsd:restriction>
			</xsd:simpleType>
		</xsd:element>
		<xsd:element minOccurs="0" name="info">
			<xsd:simpleType>
				<xsd:restriction base="this:Info">
					<xsd:maxLength value="30"/>
				</xsd:restriction>
			</xsd:simpleType>
		</xsd:element>
	</xsd:sequence>
</xsd:complexType>

<xsd:simpleType name="start_list">
	<xsd:list itemType="xsd:string"/>
</xsd:simpleType>

<xsd:simpleType name='List_ref'>
	<xsd:restriction base='this:start_list'>
		<xsd:length value="4"/>
	</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name='Info'>
	<xsd:restriction base='xsd:string'/>
</xsd:simpleType>

<simpleType name="ID">
	<restriction base="xsd:anyURI" />
</simpleType>

<complexType name="TypeWithIDs">
  <sequence>
    <element name="id1" type="this:ID" />
    <element name="id2" type="xsd:ID" />
  </sequence>
</complexType>

</xsd:schema>
