<!--
 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:
  Bence Janos Szabo – initial implementation
 -->
<xs:schema xmlns="http://www.w3.org/2001/XMLSchema"
	targetNamespace="www.example.org/list/complextype"
	xmlns:this="www.example.org/list/complextype"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
	elementFormDefault="unqualified">


<xs:complexType name="ComplexTypeWithList">
	<xs:sequence>
		<xs:element name="ElementWithList">
			<xs:simpleType>
				<xs:restriction>
					<xs:simpleType>
						<xs:list itemType="xs:float" />
					</xs:simpleType>
					<xs:minLength value="3" />
					<xs:maxLength value="3" />
				</xs:restriction>
			</xs:simpleType>
		</xs:element>
	</xs:sequence>
</xs:complexType>

<xs:element name="ElementWithList">
	<xs:simpleType>
		<xs:restriction>
			<xs:simpleType>
				<xs:list itemType="xs:float" />
			</xs:simpleType>
			<xs:minLength value="3" />
			<xs:maxLength value="3" />
		</xs:restriction>
	</xs:simpleType>
</xs:element>

<xs:element name="ElementWithList2">
	<xs:simpleType>
		<xs:restriction>
			<xs:simpleType>
				<xs:list>
					<xs:simpleType>
						<xs:restriction base="xs:string">
							<xs:length value="4" />
						</xs:restriction>
					</xs:simpleType>
				</xs:list>    
			</xs:simpleType>
			<xs:minLength value="3" />
			<xs:maxLength value="3" />
		</xs:restriction>
	</xs:simpleType>
</xs:element>

<xs:complexType name="ChoiceWithList">
	<xs:choice>
		<xs:element name="Element1">
			<xs:simpleType>
				<xs:restriction>
					<xs:simpleType>
						<xs:list itemType="xs:float" />
					</xs:simpleType>
					<xs:minLength value="3" />
					<xs:maxLength value="3" />
				</xs:restriction>
			</xs:simpleType>
		</xs:element>
		<xs:element name="Element2">
			<xs:simpleType>
				<xs:list itemType="xs:string" />
			</xs:simpleType>
		</xs:element>
	</xs:choice>
</xs:complexType>

<xs:complexType name="ChoiceWithList2">
	<xs:choice>
		<xs:element name="Element1">
			<xs:simpleType>
				<xs:restriction>
					<xs:simpleType>
						<xs:list itemType="xs:float" />
					</xs:simpleType>
					<xs:minLength value="3" />
					<xs:maxLength value="3" />
				</xs:restriction>
			</xs:simpleType>
		</xs:element>
		<xs:element name="Element2">
			<xs:simpleType>
				<xs:list itemType="xs:string" />
			</xs:simpleType>
		</xs:element>
		<xs:element name="Element3">
			<xs:simpleType>
				<xs:restriction>
					<xs:simpleType>
						<xs:list>
							<xs:simpleType>
								<xs:restriction base="string">
									<xs:length value="4" />
								</xs:restriction>
							</xs:simpleType>
						</xs:list> 
					</xs:simpleType>
					<xs:minLength value="3" />
					<xs:maxLength value="3" />
				</xs:restriction>
			</xs:simpleType>
		</xs:element>
	</xs:choice>
</xs:complexType>

<xs:simpleType name="ipv4">
	<xs:restriction base="xs:token">
		<xs:pattern value="IPV4"/>
	</xs:restriction>
</xs:simpleType>

<xs:simpleType name="ipv6">
	<xs:restriction base="xs:token">
		<xs:pattern value="IPV6"/>
	</xs:restriction>
</xs:simpleType>

<xs:complexType name="a">
	<xs:sequence>
		<xs:element name="b" type="xs:string"/>
		<xs:element name="c" type="xs:integer"/>
		<xs:element name="d" minOccurs="0" maxOccurs="unbounded">
			<xs:complexType>
				<xs:sequence>
					<xs:element name="e" type="xs:integer" minOccurs="0"/>
					<xs:element name="f" minOccurs="0">
						<xs:complexType>
							<xs:sequence>
								<xs:element name="ipv4addresses" minOccurs="0" maxOccurs="1">
									<xs:simpleType>
										<xs:restriction>
											<xs:simpleType>
												<xs:list itemType="this:ipv4"/>
											</xs:simpleType>
											<xs:minLength value="1"/>
										</xs:restriction>
									</xs:simpleType>
								</xs:element>
								<xs:element name="ipv6addresses" minOccurs="0" maxOccurs="1">
									<xs:simpleType>
										<xs:restriction>
											<xs:simpleType>
												<xs:list itemType="this:ipv6"/>
											</xs:simpleType>
											<xs:minLength value="1"/>
										</xs:restriction>
									</xs:simpleType>
								</xs:element>
							</xs:sequence>
						</xs:complexType>
					</xs:element>
					<xs:element name="g" type="xs:string" minOccurs="0"/>
				</xs:sequence>
			</xs:complexType>
		</xs:element>			
	</xs:sequence>
</xs:complexType>

</xs:schema>
