<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sepa="urn:iso:std:iso:20022:tech:xsd:pain.001.001.09" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" xmlns:nosepa="urn:iso:std:iso:20022:tech:xsd:pain.001.101.09" xmlns:doc="AT-Documentation" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns="THM:container:19006" targetNamespace="THM:container:19006" elementFormDefault="qualified" attributeFormDefault="unqualified" vc:minVersion="1.1">
	<!-- Source, use case, general documentation and changelog -->
	<xs:annotation>
		<xs:documentation>
			<doc:source>
				<doc:line>PSA Payment Services Austria</doc:line>
				<doc:line>Edited by Hendrik Muus</doc:line>
			</doc:source>
			<doc:useCase>
				<doc:line>Definition for validation of payments from accounts in fiduciary management</doc:line>
				<doc:line>Rules according attorny chamber of Austria apply</doc:line>
			</doc:useCase>
			<doc:changeLog>
				<doc:date on="2025-04-24">
					<doc:line>change cardinatily of THMOrdrs to 1..1 and adapt documentation</doc:line>
					<doc:line>Mark as Version 6</doc:line>
					<doc:line>Final Release</doc:line>
				</doc:date>
				<doc:date on="2025-04-04">
					<doc:line>delete schemalocations of imported schemes, leave loading mechanism to catalog mechanism to parser</doc:line>
				</doc:date>
				<doc:date on="2024-10-18">
					<doc:line>change schemalocations of imported schemes to last version</doc:line>
					<doc:line>Mark as Version 5</doc:line>
					<doc:line>Final Release</doc:line>
				</doc:date>
				<doc:date on="2024-04-04">
					<doc:line>change schemalocations of imported schemes to last version</doc:line>
					<doc:line>Mark as Version 4</doc:line>
					<doc:line>Mark as Release Candidate by file name</doc:line>
				</doc:date>
				<doc:date on="2023-10-18">
					<doc:line>change schemalocations of imported schemes to last version</doc:line>
					<doc:line>Mark as Version 3</doc:line>
					<doc:line>Mark as Release Candidate by file name</doc:line>
				</doc:date>
				<doc:date on="2023-10-10">
					<doc:line>Rearange definitions by type and name</doc:line>
					<doc:line>Rework pattern of container identification (CntnrId) to eliminate unneccesary complexity</doc:line>
					<doc:line>Rework structure of THMOrdrsType to eliminate unneccesary complexity</doc:line>
					<doc:line>Delete unneccesary own simpleType definitions having no further restrictions</doc:line>
					<doc:line>Replace types of elements having pointed to own simple types just deleted</doc:line>
					<doc:line>Replace namespace prefixes to more speaking prefixes</doc:line>
					<doc:line>Add documentation at various elements and definitions</doc:line>
					<doc:line>Mark as Release Candidate by file name</doc:line>
				</doc:date>
				<doc:date on="2023-07-12">
					<doc:line>New setup based on prior format for ISO structures of 2019</doc:line>
					<doc:line>Introduce XSD version 1.1 as imported schemes require version 1.1</doc:line>
					<doc:line>Imported name spaces
All underlying schemata can be downloaded from zv.psa.at
Pointer to resources of original name spaces can be extended with attribute "schemaLocation" pointing to lokal, network or internet file
Adjust to your needs</doc:line>
				</doc:date>
			</doc:changeLog>
		</xs:documentation>
	</xs:annotation>
	<!-- Schemes import -->
	<xs:import namespace="urn:iso:std:iso:20022:tech:xsd:pain.001.001.09">
		<xs:annotation>
			<xs:documentation xml:lang="de">Ein Parser soll damit auf die SEPA pain.001 Schema Definitionen verweisen</xs:documentation>
			<xs:documentation xml:lang="en">By this a parser shall point to the SEPA pain.001 xsd definition</xs:documentation>
		</xs:annotation>
	</xs:import>
	<xs:import namespace="urn:iso:std:iso:20022:tech:xsd:pain.001.101.09">
		<xs:annotation>
			<xs:documentation xml:lang="de">Ein Parser soll damit auf die NON SEPA pain.001 Schema Definitionen verweisen</xs:documentation>
			<xs:documentation xml:lang="en">By this a parser shall point to the NON SEPA pain.001 xsd definition</xs:documentation>
		</xs:annotation>
	</xs:import>
	<!-- Version information -->
	<xs:attribute name="version" fixed="19006">
		<xs:annotation>
			<xs:documentation xml:lang="de">Version dieses Schemas</xs:documentation>
			<xs:documentation xml:lang="en">Schema version</xs:documentation>
		</xs:annotation>
	</xs:attribute>
	<xs:attribute name="lastEdit" fixed="2025-04-04">
		<xs:annotation>
			<xs:documentation xml:lang="de">Datum der letzten Veränderung</xs:documentation>
			<xs:documentation xml:lang="en">Date of last change</xs:documentation>
		</xs:annotation>
	</xs:attribute>
	<xs:attribute name="versiondate" fixed="04.04.2025">
		<xs:annotation>
			<xs:documentation xml:lang="de">Versionsdatum dieses Schemas</xs:documentation>
			<xs:documentation xml:lang="en">Date of schema version</xs:documentation>
		</xs:annotation>
	</xs:attribute>
	<!-- Elements -->
	<xs:element name="Document" type="Document">
		<xs:annotation>
			<xs:documentation xml:lang="de">Wurzelelement</xs:documentation>
			<xs:documentation xml:lang="en">Root element</xs:documentation>
		</xs:annotation>
	</xs:element>
	<!-- Complex types -->
	<xs:complexType name="Document">
		<xs:sequence>
			<xs:element name="THMPaymentsContainer" type="THMPaymentContainerType">
				<xs:annotation>
					<xs:documentation xml:lang="de">Container für THM Nachrichten zwischen Bank und Kunde</xs:documentation>
					<xs:documentation xml:lang="en">Container for THM messages between customers and banks</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="SgntrType">
		<xs:sequence>
			<xs:element name="Sgntry" type="SgntryType">
				<xs:annotation>
					<xs:documentation xml:lang="de">Unterzeichner</xs:documentation>
					<xs:documentation xml:lang="en">Signatory</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="CreDtTm" type="sepa:ISODateTime">
				<xs:annotation>
					<xs:documentation xml:lang="de">Zeitstempel der Signatur</xs:documentation>
					<xs:documentation xml:lang="en">Timestamp of signature</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="ElctrncSgntr" type="Max1025Text">
				<xs:annotation>
					<xs:documentation xml:lang="de">Daten der electronischen Signatur</xs:documentation>
					<xs:documentation xml:lang="en">Electronic signature data</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="SgntryType">
		<xs:sequence>
			<xs:element name="Nm" type="sepa:Max70Text">
				<xs:annotation>
					<xs:documentation xml:lang="de">Name oder Identifikation des Unterzeichners z.B. RAK</xs:documentation>
					<xs:documentation xml:lang="en">Name or identification of the signatory e.g. RAK</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="Cd" type="sepa:Max16Text">
				<xs:annotation>
					<xs:documentation xml:lang="de">Kode von oder für den Unterzeichner z.B. Postleitzahl</xs:documentation>
					<xs:documentation xml:lang="en">Code assigned to or from signatory e.g. postal code</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="THMOrdrsType">
		<xs:sequence>
			<xs:choice>
				<xs:element ref="sepa:Document">
					<xs:annotation>
						<xs:documentation xml:lang="de">SEPA-Zweig</xs:documentation>
						<xs:documentation xml:lang="en">SEPA-branch</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element ref="nosepa:Document">
					<xs:annotation>
						<xs:documentation xml:lang="de">NoneSEPA-Zweig</xs:documentation>
						<xs:documentation xml:lang="en">NoneSEPA-branch</xs:documentation>
					</xs:annotation>
				</xs:element>
			</xs:choice>
			<xs:element name="Sgntr" type="SgntrType">
				<xs:annotation>
					<xs:documentation xml:lang="de">Signatur
Unterschrift der Rechtsanwaltskammer für THM Transaktionen</xs:documentation>
					<xs:documentation xml:lang="en">Signature
To apply the attorny chamber's signature to THM transactions</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="THMPaymentContainerType">
		<xs:sequence>
			<xs:element name="CntnrId" type="CntnrId">
				<xs:annotation>
					<xs:documentation xml:lang="de">Container Identifikation

Einmalige und eindeutige Identifikation des Containers. Die im Pattern definierte Struktur (YYMMDDhhmmss..) sichert 100 Jahre Eindeutigkeit bei gleichzeitig ungefähr 1300 möglichen Containern je Sekunde. UTC Zeit</xs:documentation>
					<xs:documentation xml:lang="en">Container Identification

Unique and unambiguous identification of the container. Structure defined in pattern (YYMMDDhhmmss..) ensures 100 year uniqueness while allowing about 1300 containers per second. UTC time</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="THMOrdrs" type="THMOrdrsType">
				<xs:annotation>
					<xs:documentation xml:lang="de">SEPA oder NoneSEPA Auftrag.</xs:documentation>
					<xs:documentation xml:lang="en">SEPA or NoneSEPA order.</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<!-- Simple types -->
	<xs:simpleType name="CntnrId">
		<xs:restriction base="xs:string">
			<xs:maxLength value="35"/>
			<xs:pattern value="\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[12])([01]\d|2[0-3])([0-5]\d){2}[A-Z0-9]{0,2}">
				<xs:annotation>
					<xs:documentation xml:lang="de">JJMMTThhmmss plus optional bis zu 2 Ziffern/Buchstaben</xs:documentation>
					<xs:documentation xml:lang="en">YYMMDDhhmmss optionaly plus 2 digits/characters</xs:documentation>
				</xs:annotation>
			</xs:pattern>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="Max1025Text">
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="1025"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>