<?xml version="1.0" encoding="ISO-8859-15"?>
<!-- Copyright (c) 2006 HPA (http://www.hafen-hamburg.de) -->
<!-- XSD-Version 1.0 / 14-Dec-2006 -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
	<xsd:include schemaLocation="MessageEnvelope.xsd"/>
	<xsd:include schemaLocation="TD04_core_Subj.xsd"/>
	<xsd:element name="Document">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="Metainfo" type="MetaInfoDef">
					<xsd:annotation>
						<xsd:documentation>In the TD04 interface only one recipient is used, i.e. only 2 or 3 participants can be specified for a transmission.</xsd:documentation>
						<xsd:documentation>The attribute Alias="HPA" is used for the participant code.</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element name="Messages">
					<xsd:complexType>
						<xsd:sequence maxOccurs="unbounded">
							<xsd:element name="Message" type="MessageDef"/>
						</xsd:sequence>
					</xsd:complexType>
				</xsd:element>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:complexType name="DeletionDef">
		<xsd:sequence>
			<xsd:element name="Type">
				<xsd:annotation>
					<xsd:documentation>type of object to be deleted: T = transport order,  R = wagon sequence</xsd:documentation>
					<xsd:documentation xml:lang="DE">Art des zu stornierenden Objekts: T = Transportauftrag,  R = Reihung</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:length value="1"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="ErrorMessageDef">
		<xsd:sequence>
			<xsd:element name="GeneralErrorCode">
				<xsd:annotation>
					<xsd:documentation>code assigned according to the code list in the interface description</xsd:documentation>
					<xsd:documentation xml:lang="DE">Fehlercode, s. Schnittstellenbeschreibung</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:maxLength value="5"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="ErrorType">
				<xsd:annotation>
					<xsd:documentation>A = automatic rejection, M = manual rejection</xsd:documentation>
					<xsd:documentation xml:lang="DE">A = automatische Rückweisung, M = manuelle Rückweisung</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:length value="1"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="Initiator">
				<xsd:annotation>
					<xsd:documentation>initiator of the error message</xsd:documentation>
					<xsd:documentation xml:lang="DE">Auslöser der Fehlernachricht</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:maxLength value="20"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="ShortText">
				<xsd:annotation>
					<xsd:documentation>explanatory short text regarding the error code/ error message. In the case of incorrect line structure, the line number can also be given.</xsd:documentation>
					<xsd:documentation xml:lang="DE">Kurzbeschreibung des Fehlers, u.U. auch Bezeichnung der Stelle, an der der Fehler aufgetreten ist</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:maxLength value="35"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="Text" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>explanatory text regarding the error message</xsd:documentation>
					<xsd:documentation xml:lang="DE">Erläuterung des Fehlers</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:maxLength value="200"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="IncorrectContent" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>transmission of the incorrect data field content</xsd:documentation>
					<xsd:documentation xml:lang="DE">fehlerhafter Feldinhalt</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:maxLength value="140"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="StatusValueDef">
		<xsd:sequence>
			<xsd:element name="StatusQualifier">
				<xsd:simpleType>
					<xsd:annotation>
						<xsd:documentation>status qualification code</xsd:documentation>
						<xsd:documentation xml:lang="DE">Art des Status (z.B. Auftragsstatus, Status zur Ladeeinheit, ..)</xsd:documentation>
					</xsd:annotation>
					<xsd:restriction base="xsd:string">
						<xsd:length value="1"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="StatusCode">
				<xsd:simpleType>
					<xsd:annotation>
						<xsd:documentation>status code value</xsd:documentation>
					</xsd:annotation>
					<xsd:restriction base="xsd:string">
						<xsd:length value="5"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="Status" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>status text</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:maxLength value="70"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="StatusTime" type="xsd:dateTime" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>time of occurrence</xsd:documentation>
					<xsd:documentation xml:lang="DE">Zeitpunkt des auslösenden Ereignisses</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="MessageDef">
		<xsd:annotation>
			<xsd:documentation>General Message definition</xsd:documentation>
			<xsd:documentation>Describes the contents of a message (metainfo and data)</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="MessageMetaInfo" type="MessageMetaInfoDef" minOccurs="0"/>
			<xsd:element name="Status" type="StatusDef"/>
		</xsd:sequence>
		<xsd:attribute name="ReferenceNumber" use="required">
			<xsd:annotation>
				<xsd:documentation xml:lang="EN">unique reference number identifying a single message</xsd:documentation>
				<xsd:documentation xml:lang="DE">Nachrichten-Referenz</xsd:documentation>
			</xsd:annotation>
			<xsd:simpleType>
				<xsd:restriction base="xsd:string">
					<xsd:minLength value="1"/>
					<xsd:maxLength value="35"/>
				</xsd:restriction>
			</xsd:simpleType>
		</xsd:attribute>
		<xsd:attribute name="Status" type="xsd:string" use="optional">
			<xsd:annotation>
				<xsd:documentation xml:lang="EN">not used for TD04</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>
	<xsd:complexType name="StatusInformationDef">
		<xsd:sequence>
			<xsd:element name="StatusValue" type="StatusValueDef" minOccurs="0"/>
			<xsd:element name="ATLASNumber" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>ATLAS number received via ZODIAK</xsd:documentation>
					<xsd:documentation xml:lang="DE">über ZODIAK erhaltene ATLAS-Nummer</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:maxLength value="21"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="HANumber" type="HABISNumberDef" minOccurs="0"/>
			<xsd:element name="OperatorCustomerNumber" minOccurs="0">
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:minLength value="1"/>
						<xsd:maxLength value="12"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="TrainNumber" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>reference number of the actual train</xsd:documentation>
					<xsd:documentation xml:lang="DE">Zugnummer</xsd:documentation>
				</xsd:annotation>
				<xsd:simpleType>
					<xsd:restriction base="xsd:string">
						<xsd:maxLength value="6"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="Location" type="LocationDef" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>code of the loading or discharge location</xsd:documentation>
					<xsd:documentation xml:lang="DE">Lade- oder Entladestelle, codiert</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="StatusDef">
		<xsd:sequence>
			<xsd:element name="BusinessDocumentDetail" type="BusinessDocumentDef"/>
			<xsd:choice>
				<xsd:element name="StatusInformation" type="StatusInformationDef" minOccurs="0"/>
				<xsd:element name="ErrorMessage" type="ErrorMessageDef" minOccurs="0" maxOccurs="unbounded"/>
				<xsd:element name="DeletionRequest" type="DeletionDef" minOccurs="0"/>
			</xsd:choice>
		</xsd:sequence>
	</xsd:complexType>
</xsd:schema>
