<?xml version="1.0" encoding="UTF-8"?>
<!-- CityGML Profil der AdV, LoD 1, Version 11.10.2014-->
<!-- Editor: Ulrich Gruber, Kreis Recklinghausen, Kurt-Schumacher-Allee 1,  45657 Recklinghausen -->
<!-- Weitere Informationen unter www.adv-online.de -->
<xs:schema xmlns="http://www.opengis.net/citygml/1.0"
	xmlns:xAL="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0"
	xmlns:xs="http://www.w3.org/2001/XMLSchema" 
	xmlns:gml="http://www.opengis.net/gml" 
	targetNamespace="http://www.opengis.net/citygml/1.0" elementFormDefault="qualified" attributeFormDefault="unqualified">
  	<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd" /> 
  	<xs:import namespace="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0" schemaLocation="http://docs.oasis-open.org/election/external/xAL.xsd" /> 

	<!-- ========================================================================================= -->
	<!-- ======================CityGML Core module ================================================== -->
	<!-- ========================================================================================= -->
	<!-- ======================Root Element: CityModel================================================ -->
	<!-- ========================================================================================= -->
	<xs:complexType name="CityModelType">
		<xs:annotation>
			<xs:documentation>Type describing the "root" element of any city model file. It is a collection whose members are
                restricted to be features of a city model. All features are included as cityObjectMember. </xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="gml:AbstractFeatureCollectionType">
				<xs:sequence>
					<xs:element ref="_GenericApplicationPropertyOfCityModel" minOccurs="0" maxOccurs="unbounded"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!-- ========================================================================================= -->
	<xs:element name="CityModel" type="CityModelType" substitutionGroup="gml:_FeatureCollection"/>
	<!-- ========================================================================================= -->
	<xs:element name="_GenericApplicationPropertyOfCityModel" type="xs:anyType" abstract="true"/>
	<!-- ========================================================================================= -->
	<!-- =======================================CityModel Members  ================================== -->
	<!-- ========================================================================================= -->
	<xs:element name="cityObjectMember" type="gml:FeaturePropertyType" substitutionGroup="gml:featureMember"/>
	<!-- ========================================================================================= -->
	<!-- ==================================CityObject: Base Class of all Features========================== -->
	<!-- ========================================================================================= -->
	<xs:complexType name="AbstractCityObjectType" abstract="true">
		<xs:annotation>
			<xs:documentation>Type describing the abstract superclass of most CityGML features. Its purpose is to provide a
                creation and a termination date as well as a reference to corresponding objects in other information systems. A
                generalization relation may be used to relate features, which represent the same real-world object in different
                Levels-of-Detail, i.e. a feature and its generalized counterpart(s). The direction of this relation is from the
                feature to the corresponding generalized feature.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="gml:AbstractFeatureType">
				<xs:sequence>
					<xs:element name="creationDate" type="xs:date" minOccurs="0"/>
					<xs:element name="terminationDate" type="xs:date" minOccurs="0"/>
					<xs:element name="externalReference" type="ExternalReferenceType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element ref="_GenericApplicationPropertyOfCityObject" minOccurs="0" maxOccurs="unbounded"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!-- ========================================================================================= -->
	<xs:element name="_CityObject" type="AbstractCityObjectType" abstract="true" substitutionGroup="gml:_Feature"/>
	<!-- ========================================================================================= -->
	<!-- ====================Mechanism for defining application subschemas of CityGML====================== -->
	<!-- ========================================================================================= -->
	<!-- ==CityGML provides a mechanism to derive application schemas for specific applications, e.g. noise dispersion mapping -->
	<!-- ==or management of monuments. For each application, a specific schema-file (xsd) has to be defined -->
	<!-- ==In this schema, arbitrary attributes (child elements) may be added to city objects. -->
	<!-- ==This is enabled by adding a generic element (abstract element of type anyType beeing the root type of any xml type)  -->
	<!-- ==to each feature type in CityGML. This element is named _GenericApplicationPropertyOf<CityGMLFeature>, where -->
	<!-- ==<CityGMLFeature> is replaced by the name of the corresponding element, e.g. CityObject. -->
	<!-- ==By defining an element in a subschema and by adding it to the substitution group -->
	<!-- ==_GenericApplicationPropertyOf<CityGMLFeature>, this element is added to the city object. -->
	<!-- ==For example, in a noise modelling subschema, an element -->
	<!-- ==<xs:element name="NoiseInteger" type="xs:integer" substitutionGroup="citygml:_GenericApplicationPropertyOfCityObject"/> -->
	<!-- == may be defined which may occur in each CityObject . The number of occurrences of this element is not limited. -->
	<!-- ==To assign this elements to specific city objects only, a corresponding generic element is added to each subtype -->
	<!-- ==of CityObject, e.g. Building or SolitaryVegetationObject  -->
	<!-- ========================================================================================== -->
	<xs:element name="_GenericApplicationPropertyOfCityObject" type="xs:anyType" abstract="true"/>
	<!-- ========================================================================================== -->
	<!-- ======================================== Sites ============================================= -->
	<!-- ========================================================================================== -->
	<xs:complexType name="AbstractSiteType" abstract="true">
		<xs:annotation>
			<xs:documentation>Type describing the abstract superclass for buildings, facilities, etc. Future extensions of CityGML
                like bridges and tunnels would be modelled as subclasses of _Site. As subclass of _CityObject, a _Site inherits
                all attributes and relations, in particular an id, names, external references, and generalization relations.
            </xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="AbstractCityObjectType">
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!-- ========================================================================================== -->
	<xs:element name="_Site" type="AbstractSiteType" abstract="true" substitutionGroup="_CityObject"/>
	<!-- ========================================================================================== -->
	<!-- ===========================External references (all LOD)========================================= -->
	<!-- ========================================================================================== -->
	<xs:complexType name="ExternalReferenceType">
		<xs:annotation>
			<xs:documentation>Type describing the reference to an corresponding object in an other information system, for example
                in the german cadastre ALKIS, the german topographic information system or ATKIS, or the OS MasterMap. The
                reference consists of the name of the external information system, represented by an URI, and the reference of the
                external object, given either by a string or by an URI. If the informationSystem element is missing in the
                ExternalReference, the ExternalObjectReference must be an URI, which contains an indication of the
                informationSystem.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="informationSystem" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="externalObject" type="ExternalObjectReferenceType"/>
		</xs:sequence>
	</xs:complexType>
	<!-- ========================================================================================== -->
	<xs:complexType name="ExternalObjectReferenceType">
		<xs:choice>
			<xs:element name="name" type="xs:string"/>
			<xs:element name="uri" type="xs:anyURI"/>
		</xs:choice>
	</xs:complexType>
	<!-- ========================================================================================== -->
	<!--======================================= Address (all LOD) ===================================== -->
	<!-- ======================================uses OASIS xAL Standard================================ -->
	<!-- ========================================================================================== -->
	<xs:complexType name="AddressPropertyType">
		<xs:annotation>
			<xs:documentation>Denotes the relation of an _CityObject to its addresses. The AddressPropertyType element must either
                carry a reference to an Address object or contain an Address object inline, but neither both nor none.
            </xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:restriction base="gml:AssociationType">
				<xs:sequence minOccurs="0">
					<xs:element ref="Address"/>
				</xs:sequence>
			</xs:restriction>
		</xs:complexContent>
	</xs:complexType>
	<!-- ========================================================================================== -->
	<xs:complexType name="AddressType">
		<xs:annotation>
			<xs:documentation>Type for addresses. It references the xAL address standard issued by the OASIS consortium. Please
                note, that addresses are modelled as GML features. Every address can be assigned zero or more 2D or 3D point
                geometries (one gml:MultiPoint geometry) locating the entrance(s). </xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="gml:AbstractFeatureType">
				<xs:sequence>
					<xs:element name="xalAddress" type="xalAddressPropertyType"/>
					<xs:element name="multiPoint" type="gml:MultiPointPropertyType" minOccurs="0"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!-- ========================================================================================== -->
	<xs:element name="Address" type="AddressType" substitutionGroup="gml:_Feature"/>
	<!-- ========================================================================================== -->
	<xs:element name="_GenericApplicationPropertyOfAddress" type="xs:anyType" abstract="true"/>
	<!-- ========================================================================================== -->
	<xs:complexType name="xalAddressPropertyType">
		<xs:annotation>
			<xs:documentation>Denotes the relation of an Address feature to the xAL address element.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element ref="xAL:AddressDetails"/>
		</xs:sequence>
	</xs:complexType>
	<!-- ==========================================Basic Types===================================== -->
</xs:schema>
