<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  targetNamespace="www.example.org/type/substitution/complex/cascade"
  xmlns="www.example.org/type/substitution/complex/cascade">


<xsd:element name="request" type="requestType" />
<xsd:element name="myProductionRequestType_" type="xsd:string" />
<xsd:element name="myProductionRequestType2_" type="xsd:string" />

<!-- The generic base type -->
<xsd:complexType name="requestType">
	<xsd:sequence>
		<xsd:element name="commonName" type="xsd:string"/>
	</xsd:sequence>
</xsd:complexType>

<!-- Production implementation -->
<xsd:element name="product" type="myProductionRequestType" />

<xsd:complexType name="myProductionRequestType">
	<xsd:complexContent>
		<xsd:extension base="requestType">
			<xsd:sequence>
				<xsd:element name="productionName" type="xsd:string"/>
			</xsd:sequence>
		</xsd:extension>
	</xsd:complexContent>
</xsd:complexType>


<xsd:element name="product2" type="myProductionRequestType2" />
<!-- Derived type of myProductionRequestType -->
<xsd:complexType name="myProductionRequestType2">
	<xsd:complexContent>
		<xsd:extension base="myProductionRequestType">
			<xsd:sequence>
				<xsd:element name="productItem" type="xsd:integer" minOccurs="0" />
			</xsd:sequence>
		</xsd:extension>
	</xsd:complexContent>
</xsd:complexType>

<!-- Derived type of myProductionRequestType2 -->
<xsd:complexType name="myProductionRequestType3">
	<xsd:complexContent>
		<xsd:restriction base="myProductionRequestType2">
			<xsd:sequence>
				<xsd:element name="commonName"  type="xsd:string" />
				<xsd:element name="productionName" type="xsd:string" />
				<xsd:element name="productItem" type="xsd:integer" minOccurs="1" />
			</xsd:sequence>
		</xsd:restriction>
	</xsd:complexContent>
</xsd:complexType>

<!-- Derived type of myProductionRequestType3 -->
<xsd:complexType name="myProductionRequestType4">
	<xsd:complexContent>
		<xsd:restriction base="myProductionRequestType3">
		<xsd:sequence>
			<xsd:element name="commonName"  type="xsd:string" />
			<xsd:element name="productItem" type="xsd:integer" minOccurs="1" />
		</xsd:sequence>
		</xsd:restriction>
	</xsd:complexContent>
</xsd:complexType>
    
</xsd:schema>

