<?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:19004" targetNamespace="THM:container:19004" 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="2024-04-04">
					<doc:line>change schemalocations of imported schemes to last version</doc:line>
					<doc:line>allow multiple orders in THMOrdrsType</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, adjust schemaLocation to your needs -->
	<xs:import namespace="urn:iso:std:iso:20022:tech:xsd:pain.001.001.09" schemaLocation="https://zv.psa.at/schemata/2023/ISO.pain.001.001.09.austrian.004.xsd">
		<xs:annotation>
			<xs:documentation xml:lang="de">schemaLocation gibt den Speicherort für jenes Schema an, das auch außerhalb dieser Definition zur Initierungen von Zahlungen verwendet wird. Es soll zu diesem keine Abweichung geben. Durch Anpassen dieser Angabe auf den Speicherort einer Kopie des referenzierten Schemas im eigenen Environment werden Zugriffe auf den hier gegebenen Speicherort vermieden</xs:documentation>
			<xs:documentation xml:lang="en">schemaLocation provides the source location of the scheme also used outside this definition for payment initiations. No deviation to that scheme shall occur. By adoption of this information towaards the location of a copy of referenced scheme in the own environment accessing the source location given in this place is preempted</xs:documentation>
		</xs:annotation>
	</xs:import>
	<xs:import namespace="urn:iso:std:iso:20022:tech:xsd:pain.001.101.09" schemaLocation="https://zv.psa.at/schemata/2023/ISO.pain.001.101.09.austrian.005.N.THM.xsd"/>
	<!-- Version information -->
	<xs:attribute name="version" fixed="19004">
		<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="2024-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.2024">
		<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" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation xml:lang="de">Mehrere SEPA Aufträge und/oder mehrere NoneSEPA Aufträge.

Eine Mischung SEPA/NoneSEPA ist zulässig</xs:documentation>
					<xs:documentation xml:lang="en">Multible SEPA orders and/or multible NoneSEPA orders.

Mixture of SEPA/NoneSEPA is permitted</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>