<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.2">
	<xs:element name="sendungsrueckmeldung">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="rueckmeldung_id" type="xs:string">
					<xs:annotation>
						<xs:documentation>Eindeutige OeNB ID für die gesamte Rückmeldung</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="technischer_empfaenger_oenb_id">
					<xs:annotation>
						<xs:documentation>OeNB Identnummer des tatsächlichen Empfängers der  Rückmeldung (technisch Verantwortlicher)</xs:documentation>
					</xs:annotation>
					<xs:simpleType>
						<xs:restriction base="xs:positiveInteger">
							<xs:minInclusive value="1"/>
							<xs:totalDigits value="9"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:element>
				<xs:element name="erstellungszeitpunkt" type="xs:dateTime">
					<xs:annotation>
						<xs:documentation>Zeitpunkt der Erstellung der Sendungsdatei</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="melder_id">
					<xs:annotation>
						<xs:documentation>OeNB Identnummer des Melders für den die Rückmeldung gemeldet wird</xs:documentation>
					</xs:annotation>
					<xs:simpleType>
						<xs:restriction base="xs:positiveInteger">
							<xs:minInclusive value="1"/>
							<xs:totalDigits value="9"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:element>
				<xs:choice>
					<xs:element name="fehlerliste" type="fehlerlisteType">
						<xs:annotation>
							<xs:documentation>Bei der Einspielung in der OeNB aufgetretene Fehlerliste </xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="quittung" type="quittungType">
						<xs:annotation>
							<xs:documentation>Positive oder negative Quittung zu einer Sendungseinspielung in der OeNB </xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="werterueckfragenliste" type="werterueckfragenlisteType">
						<xs:annotation>
							<xs:documentation>Rückfragen zu bestimmten Meldewerten</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:choice>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:complexType name="fehlerlisteType">
		<xs:sequence>
			<xs:element name="kopfdaten" type="kopfdatenType"/>
			<xs:element name="rueckfragehinweis" type="rueckfragehinweisType" minOccurs="0"/>
			<xs:element name="fehlerdaten">
				<xs:complexType>
					<xs:choice maxOccurs="unbounded">
						<xs:element name="fehlerdetails" type="fehlerdetailsType"/>
						<xs:element name="dim" type="dimType" maxOccurs="unbounded">
							<xs:annotation>
								<xs:documentation>Dimensionsangabe (zu einem  Konzept, Belegposition oder Stammdatum) -  Schachtelung von Dimensionen ist möglich</xs:documentation>
							</xs:annotation>
						</xs:element>
					</xs:choice>
				</xs:complexType>
			</xs:element>
			<xs:element name="pruefungen_uebersicht" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Auflistung aller Prüfungen, die in der Rücksendung in der Fehlerliste vorkommen</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:sequence>
						<xs:element name="pruefung_beschreibung" type="pruefungbeschreibungType" maxOccurs="unbounded">
							<xs:annotation>
								<xs:documentation>Beschreibung je Prüfung</xs:documentation>
							</xs:annotation>
						</xs:element>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="fehlerdetailsType">
		<xs:sequence>
			<xs:element name="fehler" type="fehlerType" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Aufgetretener Fehler bei einem gemeldeten Konzept, Belegposition oder Stammdatum</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="gemeldete_werte" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Verwendung nur bei Meldewertfehler in der Belegverarbeitung</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:choice>
						<xs:element name="gemeldeter_wert">
							<xs:annotation>
								<xs:documentation>In der OeNB gemeldeter Wert</xs:documentation>
							</xs:annotation>
							<xs:complexType>
								<xs:simpleContent>
									<xs:extension base="xs:string"/>
								</xs:simpleContent>
							</xs:complexType>
						</xs:element>
						<xs:element name="zeitreihe" type="zeitreiheType" maxOccurs="unbounded"/>
					</xs:choice>
					<xs:attribute ref="id_mw">
						<xs:annotation>
							<xs:documentation>Code des Meldewertes (für ein Konzept, Belegposition  oder Stammdatum)</xs:documentation>
						</xs:annotation>
					</xs:attribute>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="fehlerType">
		<xs:sequence>
			<xs:element name="pruefung_name" type="pruefungnameType" minOccurs="0"/>
			<xs:element name="rueckfrage_id" type="xs:string" minOccurs="0"/>
			<xs:element name="fehlerhinweis" type="fehlerhinweisType" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Zusatzinformation zum Fehler, der über die Prüfungsbeschreibung hinaus geht</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="formel_mit_werten" type="xs:string" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Verwendung nur bei Konsistenzprüfungen: mit den Meldewerten ausgefüllte Formel lt. Definition der Prüfung</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="formel_mit_werten_drillebene" type="xs:string" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute ref="id_mw" use="optional">
			<xs:annotation>
				<xs:documentation>Code des Meldewertes (für ein Konzept, Belegposition  oder Stammdatum)</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="dimType">
		<xs:choice maxOccurs="unbounded">
			<xs:choice maxOccurs="2">
				<xs:element name="dim" type="dimType"/>
				<xs:element name="dimKommentar" type="dimKommentarType">
					<xs:annotation>
						<xs:documentation>Kommentar zur jeweiligen Dimensionsausprägung</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="fehlerdetails" type="fehlerdetailsType"/>
			</xs:choice>
		</xs:choice>
		<xs:attribute ref="id" use="required">
			<xs:annotation>
				<xs:documentation>Dimension Code (Dimensionskürzel)</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="value" use="required">
			<xs:annotation>
				<xs:documentation>Dimension Wert (Dimensionsausprägung)</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:string"/>
			</xs:simpleType>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="kommentarType">
		<xs:sequence>
			<xs:element name="code" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Kommentar Code</xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:maxLength value="30"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="text" type="textType">
				<xs:annotation>
					<xs:documentation>Freitext Kommentar</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<!-- Type Attribut -->
	<xs:attribute name="id">
		<xs:simpleType>
			<xs:restriction base="xs:string">
				<xs:maxLength value="30"/>
			</xs:restriction>
		</xs:simpleType>
	</xs:attribute>
	<xs:attribute name="id_mw">
		<xs:simpleType>
			<xs:restriction base="xs:string">
				<xs:maxLength value="30"/>
			</xs:restriction>
		</xs:simpleType>
	</xs:attribute>
	<!-- Type Elemente -->
	<xs:complexType name="dimKommentarType">
		<xs:sequence>
			<xs:element name="kommentar" type="kommentarType"/>
		</xs:sequence>
	</xs:complexType>
	<xs:simpleType name="textType">
		<xs:restriction base="xs:string">
			<xs:minLength value="0"/>
			<xs:maxLength value="4000"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="pruefungbeschreibungType">
		<xs:sequence>
			<xs:element name="pruefung_name" type="pruefungnameType">
				<xs:annotation>
					<xs:documentation>Name der Prüfung (Code der Prüfung)</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="beschreibung" type="xs:string">
				<xs:annotation>
					<xs:documentation>Beschreibung der Prüfung</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="erhebungsuebergreifende_pruefung" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Dieser Block enthält bei erhebungsübergreifende Prüfungen, die in der Prüfung beinhalteten Erhebungen.</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:sequence>
						<xs:element name="code_erhebung_erhebungsuebergreifend" type="xs:string" maxOccurs="unbounded"/>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
			<xs:element name="definition" type="xs:string" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Definition bzw. Algorithmus der Prüfung (Regel)</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="kz_zurueckweisen" type="xs:boolean">
				<xs:annotation>
					<xs:documentation>true ... Verletzung der Prüfung führt zum Zurückweisen der Meldung</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="anzahl_erzeugter_fehler" type="xs:positiveInteger" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:simpleType name="pruefungnameType">
		<xs:restriction base="xs:string">
			<xs:maxLength value="100"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="sendungreferenzType">
		<xs:sequence>
			<xs:element name="sendungseingang" type="xs:dateTime">
				<xs:annotation>
					<xs:documentation>Zeitpunkt des Eingangs der referenzierten Sendung in der OeNB</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="dateiname" type="xs:string">
				<xs:annotation>
					<xs:documentation>Originaler Dateiname (Dateiname wie vom Ersteller an die OeNB gesendet) der referenzierten Sendung</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="ref_sendungs_id_oenb" type="xs:string" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Eindeutige OeNB ID für die in der OeNB eingelangte Sendung</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="ref_sendungs_id_sender" type="xs:string" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Vom Ersteller einer Sendungsdatei mitgelieferte eindeutige ID der Sendungsdatei</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="zeitreiheType">
		<xs:sequence>
			<xs:element name="vergleichsperiode" type="xs:date"/>
			<xs:element name="vergleichswert" type="xs:decimal"/>
			<xs:element name="veraenderungAbs" type="xs:decimal" minOccurs="0"/>
			<xs:element name="veraenderungRel" type="xs:decimal" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="quittungType">
		<xs:sequence>
			<xs:element name="sendung_referenz" type="sendungreferenzType"/>
			<xs:element name="typ">
				<xs:annotation>
					<xs:documentation>pos=positive Quitttung 
neg=negative Quittung (technische Fehler, Kopfdatenfehler, Strukturfehler im Dateiaufbau etc...)</xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:enumeration value="bedingt"/>
						<xs:enumeration value="pos"/>
						<xs:enumeration value="neg"/>
						<xs:enumeration value="posKonsistenz"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="verarbeitungszeitpunkt" type="xs:dateTime"/>
			<xs:element name="fehlertext" type="xs:string" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>nur bei neg. Quittung:
Fehlerursache bzw. Error Log des Fehlers der zum Syntaxfehler führte</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="kommentar" type="kommentarType" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Eventueller zusätzlicher Kommentar seitens der OeNB</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="kopfdatenType">
		<xs:sequence>
			<xs:element name="stichtag" type="xs:date" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Meldestichtag (für Stammdatenrückmeldungen nicht relevant)</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="code" type="xs:string">
				<xs:annotation>
					<xs:documentation>Code der Erhebung für Stammdaten, Beleg oder Smart cube</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="rueckmeldefrist" type="xs:date" minOccurs="0"/>
			<xs:element name="oenb_sachbearbeiter" type="xs:string" minOccurs="0"/>
			<xs:element name="oenb_sachbearbeitermail" type="xs:string" minOccurs="0"/>
			<xs:choice>
				<xs:element name="referenz_lzt_relevante_meldung_zur_gesamtmeldung" minOccurs="0">
					<xs:annotation>
						<xs:documentation>Referenz zur letzten für die Gesamtmeldung relevanten Meldung</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:sequence>
							<xs:element name="sendung_referenz" type="sendungreferenzType"/>
							<xs:element name="gesamtmeldung_version" type="xs:positiveInteger" minOccurs="0">
								<xs:annotation>
									<xs:documentation>Die in der Meldung vom Melder  angegebene Version Nummer der lzt. relevanten Meldung für die Gesamtmeldung. (nur beim Meldeformat OenbSendung.xsd möglich)</xs:documentation>
								</xs:annotation>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="zurueckgewiesene_sendung" minOccurs="0">
					<xs:annotation>
						<xs:documentation>Falls die aufgetretenen Fehler zu einer kompletten Rückweisung einer Sendung führen, wird hier die Referenz zur zurückgewiesenen Sendung angegeben</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:sequence>
							<xs:element name="sendung_referenz" type="sendungreferenzType"/>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:choice>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="werterueckfragenlisteType">
		<xs:sequence>
			<xs:element name="kopfdaten" type="kopfdatenType"/>
			<xs:element name="rueckfragehinweis" type="rueckfragehinweisType" minOccurs="0"/>
			<xs:element name="werterueckfragendaten" type="werterueckfragendatenType"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="werterueckfragendatenType">
		<xs:choice maxOccurs="unbounded">
			<xs:element name="rueckfragedetails" type="rueckfragedetailsType"/>
			<xs:element name="dimRf" type="dimRfType" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Dimensionsangabe (zu einem  Konzept, Belegposition oder Stammdatum) -  Schachtelung von Dimensionen ist möglich</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:choice>
	</xs:complexType>
	<xs:complexType name="rueckfragedetailsType">
		<xs:sequence>
			<xs:element name="rueckfragewert" type="rueckfragewertType" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Rückfrage zu einem bestimmten Meldewert</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="dimRfType">
		<xs:choice maxOccurs="unbounded">
			<xs:choice maxOccurs="2">
				<xs:element name="dimRf" type="dimRfType"/>
				<xs:element name="dimKommentar" type="dimKommentarType">
					<xs:annotation>
						<xs:documentation>Kommentar zur jeweiligen Dimensionsausprägung</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="rueckfragedetails" type="rueckfragedetailsType"/>
			</xs:choice>
		</xs:choice>
		<xs:attribute ref="id" use="required">
			<xs:annotation>
				<xs:documentation>Dimension Code (Dimensionskürzel)</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="value" use="required">
			<xs:annotation>
				<xs:documentation>Dimension Wert (Dimensionsausprägung)</xs:documentation>
			</xs:annotation>
			<xs:simpleType>
				<xs:restriction base="xs:string"/>
			</xs:simpleType>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="rueckfragewertType">
		<xs:sequence>
			<xs:element name="rueckfrage_id" type="xs:string"/>
			<xs:element name="bezeichnung" type="xs:string"/>
			<xs:element name="kategorie" type="xs:string"/>
			<xs:element name="wertRf">
				<xs:annotation>
					<xs:documentation>In der OeNB gemeldeter Wert</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="xs:string"/>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
			<xs:element name="beschreibung" type="xs:string">
				<xs:annotation>
					<xs:documentation>Beschreibung der Rückfrage bzw. Fehlertext</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="definition" type="xs:string" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Definition bzw. Algorithmus der Prüfung (Regel)</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="fehlerhinweis" type="fehlerhinweisType" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Zusatzinformation zum Fehler, der über die Prüfungsbeschreibung hinaus geht</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="formel_mit_werten" type="xs:string" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Verwendung nur bei Konsistenzprüfungen: mit den Meldewerten ausgefüllte Formel lt. Definition der Prüfung</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="formel_mit_werten_drillebene" type="xs:string" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute ref="id_mw" use="required">
			<xs:annotation>
				<xs:documentation>Code des Meldewertes (für ein Konzept, Belegposition  oder Stammdatum)</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:simpleType name="rueckfragehinweisType">
		<xs:restriction base="xs:string"/>
	</xs:simpleType>
	<xs:simpleType name="fehlerhinweisType">
		<xs:restriction base="xs:string">
			<xs:maxLength value="4000"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>