﻿<?xml version="1.0" encoding="utf-8"?>
<!-- Schema für den Iwan-Xml-Request-Handler -->
<xs:schema id="iwanXmlHanlder"
					 targetNamespace="http://schemas.webs.idu.de/iwan/iXRH"
					 elementFormDefault="qualified"
					 xmlns="http://schemas.webs.idu.de/iwan/iXRH"
					 xmlns:mstns="http://schemas.webs.idu.de/iwan/iXRH"
					 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
					 xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
					 xmlns:xs="http://www.w3.org/2001/XMLSchema"
					 xmlns:dt="urn:schemas-microsoft-com:datatypes"
					 >
	<!--
//////////////////////////////////////////////////////////////////////////////////
Einige allgemeine einfache Typen
//////////////////////////////////////////////////////////////////////////////////
-->
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		Value_Type					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:complexType name="Value_Type">
		<xs:choice>
			<xs:element name="String" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
			<xs:element name="Int" type="xs:int" minOccurs="1" maxOccurs="unbounded"/>
			<xs:element name="Long" type="xs:long" minOccurs="1" maxOccurs="unbounded"/>
			<xs:element name="Double" type="xs:double" minOccurs="1" maxOccurs="unbounded"/>
			<xs:element name="DateTime" type="xs:dateTime" minOccurs="1" maxOccurs="unbounded"/>
			<xs:element name="Decimal" type="xs:decimal" minOccurs="1" maxOccurs="unbounded"/>
			<xs:element name="Bool" type="xs:boolean" />
		</xs:choice>
	</xs:complexType>
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		unsignedLongGe0					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:simpleType name="unsignedLongGe0">
		<xs:restriction base="xs:unsignedLong">
			<xs:minInclusive value="0" />
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="empty">
		<xs:restriction base="xs:string">
			<xs:enumeration value=""/>
		</xs:restriction>
	</xs:simpleType>
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		unsignedLongGe1					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:simpleType name="unsignedLongGe1">
		<xs:restriction base="xs:unsignedLong">
			<xs:minInclusive value="1" />
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="ColumnName_TypeString">
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="SimpleColumnComputeFunction_Type">
		<xs:restriction base="xs:string">
			<xs:enumeration value="None">
			</xs:enumeration>
			<xs:enumeration value="STBuffer">
			</xs:enumeration>
			<xs:enumeration value="STArea">
			</xs:enumeration>
			<xs:enumeration value="STLength">
			</xs:enumeration>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="ColumnName_Type">
		<xs:simpleContent>
			<xs:extension base="ColumnName_TypeString">
				<xs:attribute name="function" use="optional" type="SimpleColumnComputeFunction_Type">
				</xs:attribute>
				<xs:attribute name="functionArg0" use="optional" type="xs:decimal"></xs:attribute>
				<xs:attribute name="alias" use="optional" type="ColumnName_TypeString"></xs:attribute>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		CompareBehaviorType					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:simpleType name="CompareBehaviorType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="Default">
				<xs:annotation>
					<xs:documentation>
						Standard-Suche, Case Vergleich von Strings, OR Vergleich, wenn mehrere Werte übergeben wurden.
					</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="CompareStringsCaseInSensitiv">
				<xs:annotation>
					<xs:documentation>
						String-Vergleich ohne Beachtung der Groß-/ Kleinschreibung durchführen.
					</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="CompareCollectionsWithAnd">
				<xs:annotation>
					<xs:documentation>
						Wenn bei einer Abfrage eine Auflistung übergeben wird, werden die Werte per Default mit OR verglichen, wenn diese Flag gesetzt ist, wird stattdessen "AND" verwendet.
					</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
		</xs:restriction>
	</xs:simpleType>
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		OperatorType					
		Hinweis: Identisch mit IDU.DB.QueryBuilder.CompareOperator
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:simpleType name="OperatorType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="Equal" />
			<xs:enumeration value="NotEqual" />
			<xs:enumeration value="Greater" />
			<xs:enumeration value="GreaterEqual" />
			<xs:enumeration value="Less" />
			<xs:enumeration value="LessEqual" />
			<xs:enumeration value="Like" />
			<xs:enumeration value="NotLike" />
			<xs:enumeration value="In" />
			<xs:enumeration value="NotIn" />
			<xs:enumeration value="Between" />
			<xs:enumeration value="IsNull" />
			<xs:enumeration value="IsNotNull" />
		</xs:restriction>
	</xs:simpleType>
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		GeomOperatorType					
		Hinweis: Identisch mit IDU.DB.QueryBuilder.GeomCompareOperator
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:simpleType name="GeomOperatorType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="DefaultRelateT8Stars">
				<xs:annotation>
					<xs:documentation>
						Ein Relate mit der Maske T*******.
					</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="BBoxCompare">
				<xs:annotation>
					<xs:documentation>Nur die BBox der Geometrien vergleichen</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="Intersects">
				<xs:annotation>
					<xs:documentation>ST_Intersects</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
		</xs:restriction>
	</xs:simpleType>
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		SortOrder					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:simpleType name="SortOrder">
		<xs:restriction base="xs:string">
			<xs:enumeration value="Ascend"/>
			<xs:enumeration value="Descend"/>
		</xs:restriction>
	</xs:simpleType>
	<!--
//////////////////////////////////////////////////////////////////////////////////
Datenausführungsplan
//////////////////////////////////////////////////////////////////////////////////
-->
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		QueryElementBase_Type					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:complexType abstract="true" name="QueryElementBase_Type">
	</xs:complexType>
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		Query_OutputHint					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:complexType name="RecordsReturnType_Base" abstract="true">
		<xs:attribute name="embedPrimaryGeometry" default="true" type="xs:boolean">
			<xs:annotation>
				<xs:documentation>Die Geometriespalte mit ausgeben.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="embedRowIdColumns" default="true" type="xs:boolean">
			<xs:annotation>
				<xs:documentation>Die als Row-Id markierten Spalten mit ausgeben, wenn diese bereits in Columns enthalten sind, passiert nichts weiter.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType abstract="false" name="Query_OutputHint">
		<xs:annotation>
			<xs:documentation>
				Weitere Parameter, die das Abrufen der Daten beeinflussen (Sortierung, Limit, Distinct).
			</xs:documentation>
		</xs:annotation>
		<xs:choice>
			<xs:element name="CountOnly" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Gibt nur die Zeilenzahl zurück (entspricht Count(*)).</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="Records" minOccurs="1" maxOccurs="1">
				<xs:complexType>
					<xs:sequence>
						<xs:choice minOccurs="0" maxOccurs="1">
							<xs:annotation>
								<xs:documentation>
									Steuert,welche Spalten zurückgegeben werden sollen.
									Ist das Element nicht vorhanden, werden alle Spalten (inkl. der primären Geometrie und der RowIds) zurückgegeben, wenn vorhanden dann nur die angegebenen.
								</xs:documentation>
							</xs:annotation>
							<xs:element name="Columns" minOccurs="1" maxOccurs="1">
								<xs:annotation>
									<xs:documentation>
										Gibt Sachdaten, RowId und Geometriespalte aus (siehe Attribute)
									</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:complexContent>
										<xs:extension base="RecordsReturnType_Base">
											<xs:sequence minOccurs="1" maxOccurs="1">
												<xs:annotation>
													<xs:documentation>Die Namen der Spalten, die zurückgeliefert werden sollen</xs:documentation>
												</xs:annotation>
												<xs:element name="Col" type="ColumnName_Type" minOccurs="0" maxOccurs="unbounded"/>
											</xs:sequence>
										</xs:extension>
									</xs:complexContent>
								</xs:complexType>
							</xs:element>
							<xs:element name="AllColumns" minOccurs="1" maxOccurs="1">
								<xs:annotation>
									<xs:documentation>
										Gibt alle Sachdatenspalten,die RowId und Geometriespalte je nach Attribut aus.
									</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:complexContent>
										<xs:extension base="RecordsReturnType_Base"/>
									</xs:complexContent>
								</xs:complexType>
							</xs:element>

							<xs:element name="OnlyPseudoColumns" minOccurs="1" maxOccurs="1">
								<xs:annotation>
									<xs:documentation>
										Gibt nur die RowId und die Geometriespalte, aber keine weiteren Sachdaten aus.
									</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:complexContent>
										<xs:extension base="RecordsReturnType_Base"/>
									</xs:complexContent>
								</xs:complexType>
							</xs:element>
						</xs:choice>
						<xs:element name="Order" minOccurs="0" maxOccurs="1" nillable="false">
							<xs:annotation>
								<xs:documentation>
									Spalten, nach der eine Sortierung erfolgen soll.
								</xs:documentation>
							</xs:annotation>
							<xs:complexType>
								<xs:sequence>
									<xs:element name="Column" minOccurs="1" maxOccurs="unbounded">
										<xs:annotation>
											<xs:documentation>Der Name der Spalte nach der die Sortierung vorgenommen werden soll.</xs:documentation>
										</xs:annotation>
										<xs:complexType>
											<xs:simpleContent>
												<xs:extension base="ColumnName_Type">
													<xs:attribute name="direction" default="Ascend" type="SortOrder">
														<xs:annotation>
															<xs:documentation>Sortierrichtung, Aufsteigen (Ascend, Standard) ober Absteigen (Descend).</xs:documentation>
														</xs:annotation>
													</xs:attribute>
												</xs:extension>
											</xs:simpleContent>
										</xs:complexType>
									</xs:element>
								</xs:sequence>
							</xs:complexType>
						</xs:element>
						<xs:element name="Limit" minOccurs="0" maxOccurs="1" type="unsignedLongGe0">
							<xs:annotation>
								<xs:documentation>
									Beschränkung der Anzahl der abzurufenden Zeilen.
								</xs:documentation>
							</xs:annotation>
						</xs:element>
					</xs:sequence>
					<xs:attribute name="distinct" default="false" type="xs:boolean">
						<xs:annotation>
							<xs:documentation>Eindeutige Werte, kann nicht mit Geometrie und sollte nicht mit RowIds kombiniert werden.</xs:documentation>
						</xs:annotation>
					</xs:attribute>
				</xs:complexType>
			</xs:element>
		</xs:choice>
	</xs:complexType>

	<!--
//////////////////////////////////////////////////////////////////////////////////
  Alles rund um Aggregate
//////////////////////////////////////////////////////////////////////////////////
-->
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		AggregateFunction_Type					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:complexType name="AggregateFunction_Type">
	</xs:complexType>
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		AggregateFunctionWithColumn_Type					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:complexType name="AggregateFunctionWithColumn_Type">
		<xs:complexContent>
			<xs:extension base="AggregateFunction_Type">
				<xs:sequence>
					<xs:element name="ColumnName" type="ColumnName_Type">
						<xs:annotation>
							<xs:documentation>
								Der Name der Spalte aus der vorhergehenden Operation.
								Für die Weiterverarbeitung sollte ein Alias vergeben werden, wenn nicht, wird automatisch {Function}_{ColName} genommen (Bsp.: MIN_MeineSpalte).
							</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		Aggregate_Type					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:complexType name="Aggregate_Type">
		<xs:annotation>
			<xs:documentation>
				Definiert spaltenbezogenen Aggregatfunktionen und Gruppierungen.
			</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="QueryElementBase_Type">
				<xs:sequence>
					<xs:choice minOccurs="0" maxOccurs="unbounded">
						<xs:element name="Min" type="AggregateFunctionWithColumn_Type"/>
						<xs:element name="Max" type="AggregateFunctionWithColumn_Type"/>
						<xs:element name="Avg" type="AggregateFunctionWithColumn_Type"/>
						<xs:element name="Sum" type="AggregateFunctionWithColumn_Type"/>
						<xs:element name="Count" type="AggregateFunctionWithColumn_Type"/>
						<xs:element name="GeomUnion" type="AggregateFunctionWithColumn_Type"/>
					</xs:choice>
					<xs:element name="GroupBy" type="ColumnName_Type" minOccurs="0" maxOccurs="unbounded">
						<xs:annotation>
							<xs:documentation>
								Spaltenweise Gruppierungen.
							</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		AnyComparisonBaseType					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:complexType name="AnyComparisonBaseType" abstract="true">
		<xs:attribute name="negateExpression" type="xs:boolean" default="false">
			<xs:annotation>
				<xs:documentation>Gibt an, ob der Ausdruck "verneint" werden soll.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		ComparisonBaseType					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:complexType name="ComparisonBaseType" abstract="true">
		<xs:complexContent>
			<xs:extension base="AnyComparisonBaseType"/>
		</xs:complexContent>
	</xs:complexType>
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		StringValue					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:complexType name="StringValue">
		<xs:simpleContent>
			<xs:extension base="xs:string" />
		</xs:simpleContent>
	</xs:complexType>

	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		SingleComparisonType					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:complexType name="SingleComparisonType" abstract="false" final="#all">
		<xs:annotation>
			<xs:documentation>
				Erlaubt die Definition eines Vergleichsausdrucks. Kann als Bestandteil einer CombinedComparisonBaseType für die Formulierung komplexer Ausdrücke verwendet werden.
			</xs:documentation>
			<xs:documentation>
				Für Geometrievergleiche steht der Typ SingleGeomComparisonType zur Verfügung.
			</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="ComparisonBaseType">
				<xs:sequence>
					<xs:choice>
						<xs:annotation>
							<xs:documentation>Die Datenquelle für die linke Seite des Vergleichs.</xs:documentation>
						</xs:annotation>
						<xs:element name="ColumnName" type="ColumnName_Type" nillable="false">
							<xs:annotation>
								<xs:documentation>Ein Spaltenname</xs:documentation>
							</xs:annotation>
						</xs:element>
						<xs:element name="RowIdColumn" nillable="false" type="empty">
							<xs:annotation>
								<xs:documentation>Die interne Row-Id Spalte</xs:documentation>
							</xs:annotation>
						</xs:element>
					</xs:choice>
					<xs:element name="Is" type="OperatorType" minOccurs="1" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>
								Die Art des Vergleichs/Vergleichsoperator.
							</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:choice>
						<xs:annotation>
							<xs:documentation>Die Datenquelle für die rechte Seite des Vergleichs.</xs:documentation>
						</xs:annotation>
						<xs:element name="Value" maxOccurs="1" minOccurs="1" type="Value_Type" nillable="true" />
						<xs:element name="CompareColumn" type="ColumnName_Type" nillable="false" maxOccurs="1" minOccurs="1" />
					</xs:choice>
				</xs:sequence>
				<xs:attribute name="compareBehavior" default="Default">
					<xs:simpleType>
						<xs:list itemType="CompareBehaviorType"/>
					</xs:simpleType>
				</xs:attribute>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		SingleGeomComparisonType					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:complexType name="SingleGeomComparisonType" abstract="false" final="#all">
		<xs:annotation>
			<xs:documentation>
				Erlaubt die Definition eines Vergleichsausdrucks für Geometrien. Kann als Bestandteil einer CombinedComparisonBaseType für die Formulierung komplexer Ausdrücke verwendet werden.
			</xs:documentation>
			<xs:documentation>
				Für alle anderen Datentypen steht der Typ SingleComparisonType zur Verfügung.
			</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="ComparisonBaseType">
				<xs:sequence>
					<xs:element name="ColumnName" type="xs:string" nillable="false"/>
					<xs:element name="Is" type="GeomOperatorType" minOccurs="1" maxOccurs="1" />
					<xs:choice>
						<xs:element name="Value" minOccurs="1" maxOccurs="unbounded" type="xs:string" nillable="false">
							<xs:annotation>
								<xs:documentation>
									Eine Geometriekonstante (WKT, WKB, Iwan).
								</xs:documentation>
							</xs:annotation>
						</xs:element>
						<xs:element name="CompareColumn" type="ColumnName_Type" nillable="false" maxOccurs="1" minOccurs="1" />
					</xs:choice>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		CombinedComparisonBaseType					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:complexType name="CombinedComparisonBaseType" abstract="true">
		<xs:annotation>
			<xs:documentation>
				Erlaubt die Definition eines komplexen Vergleichsausdrucks. Das Blatt des Ausdrucksbaumes muss in einer Single(Geom)Comparison enden.
			</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="ComparisonBaseType">
				<xs:sequence>
					<xs:choice minOccurs="2" maxOccurs="unbounded">
						<xs:element name="SingleComparison" type="SingleComparisonType" />
						<xs:element name="SingleGeomComparison" type="SingleGeomComparisonType" />
						<xs:element name="And" type="CombinedComparisonAndType" />
						<xs:element name="Or" type="CombinedComparisonOrType" />
					</xs:choice>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		CombinedComparisonAndType					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:complexType name="CombinedComparisonAndType" final="#all">
		<xs:complexContent>
			<xs:extension base="CombinedComparisonBaseType">
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		CombinedComparisonOrType					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:complexType name="CombinedComparisonOrType" final="#all">
		<xs:complexContent>
			<xs:extension base="CombinedComparisonBaseType">
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		Filter_Type					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:complexType name="Filter_Type">
		<xs:complexContent>
			<xs:extension base="QueryElementBase_Type">
				<xs:sequence>
					<xs:choice minOccurs="1" maxOccurs="1">
						<xs:element name="SingleComparison" type="SingleComparisonType" />
						<xs:element name="SingleGeomComparison" type="SingleGeomComparisonType" />
						<xs:element name="And" type="CombinedComparisonAndType" />
						<xs:element name="Or" type="CombinedComparisonOrType" />
					</xs:choice>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="ComputeColumnFunctionBase_Type" abstract="true">
		<xs:attribute name="targetColumnName" type="ColumnName_TypeString">
			<xs:annotation>
				<xs:documentation>
					Name der Ausgabespalte.
				</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<!-- WIP ! -->
	<xs:complexType name="Processor_Type">
		<xs:complexContent>
			<xs:extension base="QueryElementBase_Type">
				<xs:choice maxOccurs="unbounded" minOccurs="1">
					<xs:element name="ST_Area">
					</xs:element>
				</xs:choice>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		QueryType_Type					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:complexType name="QueryType_Type">
		<xs:annotation>
			<xs:documentation>Der Plan für eine Datenbeschaffung. Im Ergebnis wird immer ein IDataReader dem Aufrufer zur Verfügung gestellt.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="Compute" minOccurs="0" maxOccurs="1"  nillable="false" type="Processor_Type">
			</xs:element>
			<xs:element name="Aggregate" minOccurs="0" maxOccurs="1" nillable="false" type="Aggregate_Type">
			</xs:element>
			<xs:element name="Filter" minOccurs="0" maxOccurs="1" nillable="false" type="Filter_Type">
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		QueryTypeWithOutputHint_Type					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:complexType name="QueryTypeWithOutputHint_Type">
		<xs:complexContent>
			<xs:extension base="QueryType_Type">
				<xs:sequence>
					<xs:element name="Return" type="Query_OutputHint" minOccurs="1" maxOccurs="1" nillable="false" >
						<xs:annotation>
							<xs:documentation>
								Hinweis für die Spalten, Einschränkung und Sortierung.
							</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="BoundingBox_Type">
		<xs:attribute name="xmin" type="xs:double" use="required"/>
		<xs:attribute name="ymin" type="xs:double" use="required"/>
		<xs:attribute name="xmax" type="xs:double" use="required"/>
		<xs:attribute name="ymax" type="xs:double" use="required"/>
		<xs:attribute name="epsgCode" type="xs:int" use="required"/>
	</xs:complexType>
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	  Zeichen-Argumente
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  -->
	<!-- 
	RenderLayer_BaseType  Basisklasse für Layer innerhalb der Zeichenoperationen
	-->
	<xs:complexType abstract="true" name="RenderLayer_BaseType">
		<xs:sequence>
			<xs:element name="ScaleRangeOverride" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Hier kann der Min/MaxScale der Ebene überschrieben werden. passiert bereits, wenn das Element vorhanden ist</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:attribute name="minScale" type="xs:double" use="optional"></xs:attribute>
					<xs:attribute name="maxScale" type="xs:double" use="optional"></xs:attribute>
				</xs:complexType>
			</xs:element>
		</xs:sequence>

		<xs:attribute name="layerName" type="xs:token" use="required">
			<xs:annotation>
				<xs:documentation>
					Der interne Name der Ebene.
				</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<!-- 
	RenderLayer_BaseType  "normaler" Layer innerhalb einer Zeichenoperationen
	-->
	<xs:complexType name="SelRenderLayer_Type" final="#all">
		<xs:complexContent>
			<xs:extension base="RenderLayer_BaseType">
				<xs:attribute name="guid" type="xs:token" use="optional">
					<xs:annotation>
						<xs:documentation>
							Die bei der Erstellung vergebene Guid der Selektionsebene. Wenn der Aufruf Sitzungslos sind, ist die Angabe erforderlich.
							Bei Sitzungsstatus wird die 1. Sel-Ebene für den Layer der aktuellen Sitzung verwendet.
						</xs:documentation>
					</xs:annotation>
				</xs:attribute>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!-- 
	RenderLayer_BaseType  "normaler" Layer innerhalb einer Zeichenoperationen
	-->
	<xs:complexType name="RenderLayerWithFilter_Type" final="#all">
		<xs:complexContent>
			<xs:extension base="RenderLayer_BaseType">
				<xs:sequence>
					<xs:element name="Filter" type="Filter_Type" minOccurs="0" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>Ein optionaler Filter-Ausdruck für die aktuelle Ebene.</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!-- 
	RenderLayerWithCSS_Type, nur für Iwan7 Ebenen, es kann CSS mit transportiert werden, welches Iwan7 entsprechend interpretiert.
	-->
	<xs:complexType name="RenderLayerWithCSS_Type" final="#all">
		<xs:complexContent>
			<xs:extension base="RenderLayer_BaseType">
				<xs:sequence>
					<xs:element name="Filter" type="Filter_Type" minOccurs="0" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>Ein optionaler Filter-Ausdruck für die aktuelle Ebene.</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="Css" type="xs:string" minOccurs="0" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>Das CSS für die Ebene</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!--
	Mögliche Bildformate
	-->
	<xs:simpleType name="RenderMapTargetImageType">
		<xs:restriction base="xs:string">
			<xs:enumeration  value="Png" />
			<xs:enumeration  value="Png8" />
			<xs:enumeration  value="Png32" />
			<xs:enumeration  value="Jpg" />
			<xs:enumeration  value="Gif" />
			<xs:enumeration  value="Ecw" />
			<!--
      <xs:enumeration  value="Emf" />
      -->
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="Units">
		<xs:restriction base="xs:string">
			<xs:enumeration value="Percent">
				<xs:annotation>
					<xs:documentation>Prozentualer Wert</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="Map">
				<xs:annotation>
					<xs:documentation>Karteneinheiten</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="Meters">
				<xs:annotation>
					<xs:documentation>Meter</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="RenderMapDrawExtentHintRecord_Type">
		<xs:attribute name="offsetValue" type="xs:double" use="required"></xs:attribute>
		<xs:attribute name="unit" type="Units" default="Percent"></xs:attribute>
		<xs:attribute name="pointFactor" type="xs:double" default="1.0"></xs:attribute>
		<xs:attribute name="linePolyFactor" type="xs:double" default="1.0" ></xs:attribute>
		<xs:attribute name="annoFactor" type="xs:double" default="1.0"></xs:attribute>
	</xs:complexType>
	<xs:complexType name="RenderMapDrawExtentHints_Type">
		<xs:choice>
			<xs:element name="Common" type="RenderMapDrawExtentHintRecord_Type" minOccurs="1" maxOccurs="1" nillable="false">
			</xs:element>
			<xs:element name="PerSide" minOccurs="1" maxOccurs="1" nillable="false">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="Top" type="RenderMapDrawExtentHintRecord_Type" minOccurs="0" maxOccurs="1">
						</xs:element>
						<xs:element name="Left" type="RenderMapDrawExtentHintRecord_Type" minOccurs="0" maxOccurs="1">
						</xs:element>
						<xs:element name="Bottom" type="RenderMapDrawExtentHintRecord_Type" minOccurs="0" maxOccurs="1">
						</xs:element>
						<xs:element name="Right" type="RenderMapDrawExtentHintRecord_Type" minOccurs="0" maxOccurs="1">
						</xs:element>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
		</xs:choice>
	</xs:complexType>
	<xs:complexType name="RenderMapArguments_Type">
		<xs:sequence>
			<xs:element name="BBox" minOccurs="1" maxOccurs="1" nillable="false" type="BoundingBox_Type">
				<xs:annotation>
					<xs:documentation>Zeichenbereich.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="DrawExtentHints" type="RenderMapDrawExtentHints_Type"  minOccurs="0" maxOccurs="1" nillable="false" >
				<xs:annotation>
					<xs:documentation>Für Kachelkarten sollte hier der Extent vergrößert werden um das Abschneiden von Elementen zu vermeiden.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Liste der Ebenen oder Selektionsebenen in der Darstellungsreihenfolge</xs:documentation>
				</xs:annotation>
				<xs:element name="Layer" minOccurs="0" maxOccurs="unbounded" type="RenderLayerWithFilter_Type">
					<xs:annotation>
						<xs:documentation>
							Rendert eine Ebene aus dem aktuellen Projekt
						</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="SelLayer" minOccurs="0" maxOccurs="unbounded" type="SelRenderLayer_Type">
					<xs:annotation>
						<xs:documentation>
							Rendert eine Ebene mit sellayer-create erstellten Selektionsebene
						</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="LayerWithCss" minOccurs="0" maxOccurs="unbounded" type="RenderLayerWithCSS_Type">
					<xs:annotation>
						<xs:documentation>
							Rendert eine Ebene aus dem aktuellen Projekt, bei der Ebene muss es sich um eine Iwan7 Ebene handeln.
						</xs:documentation>
					</xs:annotation>
				</xs:element>
			</xs:choice>
			<xs:element name="MapDecorations" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Weitere Darstellungen als Überlagerung zum Kartenbild.</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:sequence>
						<xs:choice minOccurs="1" maxOccurs="unbounded">
							<xs:element name="SketchJson" type="xs:string">
								<xs:annotation>
									<xs:documentation>In JSON serialisierte Sketch-Graphik.</xs:documentation>
								</xs:annotation>
							</xs:element>
						</xs:choice>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="imageWidth" type="xs:unsignedShort" use="required">
			<xs:annotation>
				<xs:documentation>Bildbreite in Pixeln.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="imageHeight" type="xs:unsignedShort" use="required">
			<xs:annotation>
				<xs:documentation>Bildhöhe in Pixeln.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="imageSizeLargestEdge" type="xs:unsignedInt" use="optional">
			<xs:annotation>
				<xs:documentation>Die physische Bildgröße in Pixeln der längsten Kante. Ist dieser Wert gesetzt, wird imageWidth/height als virtuelle Größe angenommen.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="epsgCode" type="xs:int" default="-1">
			<xs:annotation>
				<xs:documentation>EPSG-Code für die Ziel-Projektion, wenn nicht definiert, dann wird die EPSG der BBox verwendet.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="targetImageType" type="RenderMapTargetImageType" default="Png">
			<xs:annotation>
				<xs:documentation>Der Bildtyp für die Ausgabe. Hinweis: das tatsächlich erstellte Bildformat kann je nach Ebeneneinstellungen abweichen.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="backgroundColor" type="xs:normalizedString" default="0xFFFFFF">
			<xs:annotation>
				<xs:documentation>Hintergrundfarbe.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="transparentColor" type="xs:normalizedString" default="0xFFFFFF">
			<xs:annotation>
				<xs:documentation>Transparenzfarbe.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="makeTransparent" type="xs:boolean" default="false">
			<xs:annotation>
				<xs:documentation>Gibt an, ob das Bild transparent ausgegeben werden soll.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="printMode" type="xs:boolean" default="false">
			<xs:annotation>
				<xs:documentation>Hinweis, ob die Symboleinstellungen für den Print-Mode verwenden werden sollen.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="collectDrawStat" type="xs:boolean" default="true">
			<xs:annotation>
				<xs:documentation>Zeichenstatistik für diese Anforderung erfassen.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="drawSelection" type="xs:boolean" default="true">
			<xs:annotation>
				<xs:documentation>Evtl. vorhandene Selektionen darstellen.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="drawingTimeoutMilliseconds" type="xs:unsignedInt" use="optional">
			<xs:annotation>
				<xs:documentation>Timeout für diese Zeichenanforderung in Millisekunden, wenn nicht definiert, dann wird der Standardwert des Projektes verwendet.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="imageAlpha" type="xs:float" use="optional">
			<xs:annotation>
				<xs:documentation>
					Opazität des Ausgabebildes, im Bereich 0...1.
					Hinweis: erfordert Png32.
				</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<!--
	SelLayerCollection
	-->
	<xs:element name="SelLayerCollection">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="SelLayer" minOccurs="1" maxOccurs="unbounded">
					<xs:complexType>
						<xs:attribute name="layerName" type="xs:token" use="required">
							<xs:annotation>
								<xs:documentation>
									Der interne Name der Ebene.
								</xs:documentation>
							</xs:annotation>
						</xs:attribute>
						<xs:attribute name="selLayerGuid" type="xs:token" use="required">
							<xs:annotation>
								<xs:documentation>
									Die Guid der Selektion
								</xs:documentation>
							</xs:annotation>
						</xs:attribute>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
			<xs:attribute name="sessionIndependend" default="false" type="xs:boolean">
				<xs:annotation>
					<xs:documentation>Gibt an, ob der Vorgang sitzungsübergreifend stattfinden soll, auch wenn der Request in einer Sitzung ausgeführt wird.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	<!--
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		Query					
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	-->
	<xs:element name="Query" type="QueryTypeWithOutputHint_Type">
		<xs:annotation>
			<xs:documentation>
				Beschreibt eine Abfrage (x-iwan-action: reader-create oder sellayer-create).
			</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="Filter" type="Filter_Type">
		<xs:annotation>
			<xs:documentation>
				Beschreibt einen Filter.
			</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="RenderMap" type="RenderMapArguments_Type">
		<xs:annotation>
			<xs:documentation>
				Parameter für eine Bildanforderungen (x-iwan-action: render-layers).
			</xs:documentation>
		</xs:annotation>
	</xs:element>
</xs:schema>