<schema targetNamespace="http://www.example.com/Report" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:r="http://www.example.com/Report" xmlns:xipo="http://www.example.com/IPO" elementFormDefault="qualified">
	<import namespace="http://www.example.com/IPO"/>
	<annotation>
		<documentation xml:lang="en">
   Report schema for Example.com
   Copyright 2000 Example.com. All rights reserved.
  </documentation>
	</annotation>
	<element name="purchaseReport">
		<unique name="dummy1">
			<selector xpath="r:regions/r:zip"/>
			<field xpath="@code"/>
		</unique>
		<complexType>
			<sequence>
				<element name="regions" type="r:RegionsType">
					<keyref name="dummy2" refer="r:pNumKey">
						<selector xpath="r:zip/r:part"/>
						<field xpath="@number"/>
					</keyref>
				</element>
				<element name="parts" type="r:PartsType"/>
			</sequence>
			<attribute name="period" type="duration"/>
			<attribute name="periodEnding" type="date"/>
		</complexType>
		<key name="pNumKey">
			<selector xpath="r:parts/r:part"/>
			<field xpath="@number"/>
		</key>
	</element>
	<complexType name="RegionsType">
		<sequence>
			<element name="zip" maxOccurs="unbounded">
				<complexType>
					<sequence>
						<element name="part" maxOccurs="unbounded">
							<complexType>
								<complexContent>
									<restriction base="anyType">
										<attribute name="number" type="integer"/>
										<attribute name="quantity" type="positiveInteger"/>
									</restriction>
								</complexContent>
							</complexType>
						</element>
					</sequence>
					<attribute name="code" type="positiveInteger"/>
				</complexType>
			</element>
		</sequence>
	</complexType>
	<annotation>
		<documentation xml:lang="en">
  Second annotation
  </documentation>
	</annotation>
	<complexType name="PartsType">
		<sequence>
			<element name="part" maxOccurs="unbounded">
				<complexType>
					<simpleContent>
						<extension base="string">
							<attribute name="number" type="integer"/>
						</extension>
					</simpleContent>
				</complexType>
			</element>
		</sequence>
	</complexType>
</schema>
