<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (c) 2000-2021 Ericsson Telecom AB
 All rights reserved. This program and the accompanying materials
 are made available under the terms of the Eclipse Public License v2.0
 which accompanies this distribution, and is available at
 https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html

 Contributors:
  Balasko, Jeno
  Raduly, Csaba
-->
<schema  xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns="www.example.org"
targetNamespace="www.example.org">

<complexType name="e23">
	<simpleContent>
		<extension base="string">
			<attribute name="foo" type="float"/>
			<attribute name="bar" type="integer"/>
		</extension>
	</simpleContent>
</complexType>

<complexType name="e24">
	<simpleContent>
		<restriction base="ns:e23">
			<length value="4"/>
		</restriction>
	</simpleContent>
</complexType>

<complexType name="e25seq">
	<sequence>
		<element name= "title" type="string"/>
		<element name="forename" type="string"/>
		<element name="surname" type="string"/>
	</sequence>
	<attribute name="gender" type="integer"/>
	<attributeGroup ref="ns:g25attr2"/>
</complexType>

<annotation><documentation xml:lang="en">
where g25attr1 is:
</documentation></annotation>

<attributeGroup name="g25attr2">
	<attribute name="jobPosition" type="string"/>
</attributeGroup>

<annotation><documentation xml:lang="en">
Now a type is defined that extends e25seq by adding a new element, group and attributes:
</documentation></annotation>

<complexType name="e26seq">
	<complexContent>
		<extension base="ns:e25seq">
			<sequence>
				<element name="age" type="integer"/>
				<group ref="ns:g25seq"/>
			</sequence>
			<attribute name="unitOfAge" type="string"/>
			<attributeGroup ref="ns:g25attr1"/>
		</extension>
	</complexContent>
</complexType>

<annotation><documentation xml:lang="en">
where g25seq and g25attr1 are:
</documentation></annotation>

<group name="g25seq">
	<sequence>
		<element name="familyStatus" type="string"/>
		<element name="spouseName" type="string" minOccurs="0"/>
	</sequence>
</group>

<attributeGroup name="g25attr1">
	<attribute name="birthPlace" type="string"/>
	<attribute name="birthDate" type="string"/>
</attributeGroup>

<complexType name="e25cho">
	<choice>
		<element name="title" type="string"/>
		<element name="forename" type="string"/>
		<element name="surname" type="string"/>
	</choice>
	<attribute name="gender" type="string"/>
</complexType>

<annotation><documentation xml:lang="en">
and
</documentation></annotation>

<complexType name="e26cho">
	<complexContent>
		<extension base="ns:e25cho">
			<choice>
				<element name="age" type="integer"/>
				<element name="birthday" type="date"/>
			</choice>
			<attribute name="unitOfAge" type="string"/>
		</extension>
	</complexContent>
</complexType>

<complexType name="e27cho">
	<complexContent>
		<extension base="ns:e25seq">
			<choice>
				<element name="age" type="integer"/>
				<element name="birthday" type="date"/>
			</choice>
			<attribute name="unitOfAge" type="string"/>
		</extension>
	</complexContent>
</complexType>

<complexType name="e27seq">
	<complexContent>
		<extension base="ns:e25cho">
			<sequence>
				<element name="age" type="integer"/>
			</sequence>
			<attribute name="unitOfAge" type="string"/>
		</extension>
	</complexContent>
</complexType>

<complexType name="X">
	<sequence>
		<element name="x" type="string"/>
		<element name="y" minOccurs="0">
			<complexType>
				<complexContent>
					<extension base="ns:X">
						<sequence>
							<element name="z" type="string"/>
						</sequence>
					</extension>
				</complexContent>
			</complexType>
		</element>
	</sequence>
</complexType>

<complexType name="e28">
	<complexContent>
		<restriction base="anyType">
			<sequence>
				<element name="size" type="nonPositiveInteger"/>
				<element name="unit" type="NMTOKEN"/>
			</sequence>
		</restriction>
	</complexContent>
</complexType>


<annotation><documentation xml:lang="EN">
The base type is:
</documentation></annotation>

<element name="comment" type="string"/>

<simpleType name="Items">
  <restriction base="string">
  </restriction>
</simpleType>


<complexType name="PurchaseOrderType">
	<sequence>
		<element name="shipTo"     type="string"/>
		<element name="billTo"     type="string"/>
		<element ref="ns:comment" minOccurs="0"/>
		<element name="items"      type="ns:Items"/>
	</sequence>
	<attribute name="shipDate" type="date"/>
	<attribute name="orderDate" type="date"/>
</complexType>

<annotation><documentation xml:lang="EN">
The restricting type is:
</documentation></annotation>

<complexType name="RestrictedPurchaseOrderType">
	<complexContent>
		<restriction base="ns:PurchaseOrderType">
			<sequence>
				<element name="shipTo" type="string"/>
				<element name="billTo" type="string"/>
				<element ref="ns:comment" minOccurs="1"/>
				<element name="items"  type="ns:Items"/>
			</sequence>
			<attribute name="shipDate" type="date" use="required" />
			<attribute name="orderDate" type="date" use="prohibited" />
		</restriction>
	</complexContent>
</complexType>

<complexType name="e29">
	<all>
		<element name="foo" type="integer"/>
		<element name="bar" type="float"/>
		<element name="ding" type="string"/>
	</all>
</complexType>

<complexType name="e29a">
	<all minOccurs="0">
		<element name="foo" type="integer"/>
		<element name="bar" type="float"/>
		<element name="ding" type="string"/>
	</all>
</complexType>

<complexType name="e29b">
	<all>
		<element name="foo" type="integer"/>
		<element name="bar" type="float" minOccurs="0"/>
		<element name="ding" type="string"/>
	</all>
</complexType>

<complexType name="e30">
	<choice>
		<element name="foo" type="integer"/>
		<element name="bar" type="float"/>
	</choice>
</complexType>

<group name="e31">
	<sequence>
		<element name="foo" type="string"/>
		<element name="bar" type="string"/>
	</sequence>
</group>

<complexType name="e32">
	<choice>
		<group ref="ns:e31"/>
		<element name="ding" type="string"/>
	</choice>
</complexType>

<complexType name="e33">
	<choice>
		<choice>
			<element name="foo" type="string"/>
			<element name="bar" type="string"/>
		</choice>
		<element name="ding" type="string"/>
	</choice>
</complexType>

<complexType name="e34a">
	<choice>
		<sequence>
			<element name="foo" type="string"/>
			<element name="bar" type="string"/>
		</sequence>
		<element name="ding" type="string"/>
	</choice>
</complexType>

<complexType name="e34b">
	<choice>
		<sequence>
			<sequence>
				<element name="foo" type="string"/>
				<element name="bar" type="string"/>
			</sequence>
			<element name="ding" type="string"/>
			<element name="foo" type="string"/>
			<element name="bar" type="string"/>
		</sequence>
		<element name="ding" type="string"/>
	</choice>
</complexType>

<complexType name="e35">
	<choice>
		<element name="foo" type="string"/>
		<any namespace="other"/>
	</choice>
</complexType>

<complexType name="e36a">
	<sequence>
		<element name="foo" type="integer"/>
		<element name="bar" type="float"/>
	</sequence>
</complexType>

<complexType name="e36b">
	<sequence minOccurs="0">
		<element name="foo" type="integer"/>
		<element name="bar" type="float"/>
	</sequence>
</complexType>

<complexType name="e36c">
	<sequence minOccurs="0" maxOccurs="unbounded">
		<element name="foo" type="integer"/>
		<element name="bar" type="float"/>
	</sequence>
</complexType>

<group name="e37">
	<choice>
		<element name="foo" type="string"/>
		<element name="bar" type="string"/>
	</choice>
</group>

<complexType name="e38">
	<sequence>
		<group ref="ns:e37"/>
		<element name="ding" type="string"/>
	</sequence>
</complexType>

<complexType name="e39">
	<sequence>
		<choice>
			<element name="foo" type="string"/>
			<element name="bar" type="string"/>
		</choice>
		<element name="ding" type="string"/>
	</sequence>
</complexType>

<annotation><documentation xml:lang="EN"> CHECK THIS! </documentation></annotation>
<complexType name="e40a">
	<sequence>
		<sequence>
			<element name="foo" type="string"/>
			<element name="bar" type="string"/>
		</sequence>
		<element name="ding" type="string"/>
	</sequence>
</complexType>

<complexType name="e40b">
	<sequence>
		<sequence id="seq">
			<element name="foo" type="string"/>
			<element name="bar" type="string"/>
		</sequence>
		<choice id="cho">
			<element name="foo" type="string"/>
			<element name="bar" type="string"/>
		</choice>
		<element name="ding" type="string"/>
	</sequence>
</complexType>

<complexType name="e40c">
	<sequence>
		<sequence minOccurs="0">
			<element name="foo" type="string"/>
			<element name="bar" type="string"/>
		</sequence>
		<choice>
			<element name="foo" type="string"/>
			<element name="bar" type="string"/>
		</choice>
		<element name="ding" type="string"/>
	</sequence>
</complexType>

<complexType name="e40d">
	<sequence>
		<sequence minOccurs="0" maxOccurs="unbounded">
			<element name="foo" type="string"/>
			<element name="bar" type="string"/>
		</sequence>
		<choice>
			<element name="foo" type="string"/>
			<element name="bar" type="string"/>
		</choice>
		<element name="ding" type="string"/>
	</sequence>
</complexType>

<complexType name="e41">
	<sequence>
		<element name="foo" type="string"/>
		<any/>
	</sequence>
</complexType>

<attributeGroup name="e42">
	<attribute name="foo" type="float"/>
	<attribute name="bar" type="float"/>
</attributeGroup>

<attributeGroup name="e43">
	<attributeGroup ref="ns:e42"/>
	<attribute name="ding" type="string"/>
</attributeGroup>

<complexType name="e44">
	<sequence>
		<element name="ding" type="string"/>
	</sequence>
	<attributeGroup ref="ns:e42"/>
</complexType>

<element name="MySeqMixed">
	<complexType  mixed="true">
		<sequence>
			<element name="a" type="string"/>
			<element name="b" type="boolean"/>
		</sequence>
		<attribute name="attrib" type="integer"/>
	</complexType>
</element>

<complexType name="MyChoMixed" mixed="true">
	<choice>
		<element name="a" type="string"/>
		<element name="b" type="boolean"/>
	</choice>
</complexType>

<complexType name="MyAllMixed" mixed="true">
	<all>
		<element name="a" type="string"/>
		<element name="b" type="boolean"/>
	</all>
</complexType>

<complexType name="MyComplexType-16">
	<sequence maxOccurs="unbounded" minOccurs="0">
		<element name="a" type="string"/>
		<element name="b" type="boolean"/>
	</sequence>
</complexType>

<complexType name="MyComplexType-13" mixed="true">
	<all>
		<element name="a" type="string"/>
		<element name="b" type="boolean"/>
	</all>
</complexType>

<complexType name="MyComplexType-15" mixed="true">
	<all minOccurs="0">
		<element name="a" type="string"/>
		<element name="b" type="boolean"/>
	</all>
</complexType>

<complexType name="MyComplexType-14" mixed="true">
	<choice>
		<element name="a" type="string"/>
		<element name="b" type="boolean"/>
	</choice>
</complexType>

</schema>
