<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="PortOrderCancellation" type="PortOrderCancellationElementType"/>
  <xs:simpleType name="an..12">
    <xs:restriction base="xs:string">
      <xs:maxLength value="12"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="an..16">
    <xs:restriction base="xs:string">
      <xs:maxLength value="16"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="an..35">
    <xs:restriction base="xs:string">
      <xs:maxLength value="35"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="an..4">
    <xs:restriction base="xs:string">
      <xs:maxLength value="4"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="CancellationAtExitType">
    <xs:annotation>
      <xs:documentation xml:lang="DE" source="Desc">Liste von MRN die am Ausgang abgebrochen werden sollen. Nur zulässig für Anmeldeart AES.</xs:documentation>
      <xs:documentation xml:lang="EN" source="Desc">List of MRN for cancellation at exit. Only permitted for Port Order type AES.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="MRN" type="mrnType" maxOccurs="999">
        <xs:annotation>
          <xs:documentation xml:lang="DE" source="Desc">Master Reference Number (vormals Movement Reference Number)</xs:documentation>
          <xs:documentation xml:lang="DE" source="Note1">169 (3-20) für den Abbruch am Ausgang. Der Prozess der Weiterleitung wird nicht mehr unterstützt.</xs:documentation>
          <xs:documentation xml:lang="EN" source="Desc">Master reference number (previously movement reference number)</xs:documentation>
          <xs:documentation xml:lang="EN" source="Note1">169 (3-20) for the cancellation at exit. The process of forwarding will no longer be supported.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ExchangeType">
    <xs:sequence>
      <xs:element name="Transaction" type="TransactionType"/>
    </xs:sequence>
  </xs:complexType>
  <xs:simpleType name="mrnType">
    <xs:restriction base="xs:string">
      <xs:length value="18"/>
      <xs:pattern value="\d{2}[A-Z]{2}[a-zA-Z\d]{14}"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="PortOrderCancellationElementType">
    <xs:complexContent>
      <xs:extension base="ExchangeType">
        <xs:sequence>
          <xs:element name="Message" type="PortOrderCancellationMessageType"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PortOrderCancellationMessageType">
    <xs:sequence>
      <xs:element name="PortOrderType" type="portOrderTypeCode"/>
      <xs:element name="IssuerCode" type="an..4">
        <xs:annotation>
          <xs:documentation source="Desc">Issuer DAKOSY Code</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ForwarderReference" type="an..16">
        <xs:annotation>
          <xs:documentation xml:lang="DE" source="Desc">Referenznummer des Spediteurs</xs:documentation>
          <xs:documentation xml:lang="EN" source="Desc">Reference number of forwarder</xs:documentation>
          <xs:documentation xml:lang="DE" source="Note1">Referenzsatz/Referenznummer</xs:documentation>
          <xs:documentation xml:lang="EN" source="Note1">Reference sentence/reference number</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="CancellationAtExit" type="CancellationAtExitType" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>
  <xs:simpleType name="portOrderTypeCode">
    <xs:annotation>
      <xs:documentation xml:lang="EN" source="Desc">Port Order Type</xs:documentation>
      <xs:documentation xml:lang="DE" source="Desc">Port Order Typ / Anmeldeart</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:enumeration value="A08">
        <xs:annotation>
          <xs:documentation xml:lang="DE" source="Name">Kaianlieferungsantrag</xs:documentation>
          <xs:documentation xml:lang="DE" source="Desc">Kaianlieferungsantrag</xs:documentation>
          <xs:documentation xml:lang="EN" source="Name">Quay order for inbound delivery</xs:documentation>
          <xs:documentation xml:lang="EN" source="Desc">Quay order for inbound delivery</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="A09">
        <xs:annotation>
          <xs:documentation xml:lang="DE" source="Name">Kaiauslieferungsantrag</xs:documentation>
          <xs:documentation xml:lang="DE" source="Desc">Kaiauslieferungsantrag</xs:documentation>
          <xs:documentation xml:lang="EN" source="Name">Quay order for outbound delivery</xs:documentation>
          <xs:documentation xml:lang="EN" source="Desc">Quay order for outbound delivery</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="A15">
        <xs:annotation>
          <xs:documentation xml:lang="DE" source="Name">Antrag auf Kaileistungen</xs:documentation>
          <xs:documentation xml:lang="DE" source="Desc">Antrag auf Kaileistungen</xs:documentation>
          <xs:documentation xml:lang="EN" source="Name">Application for quay services</xs:documentation>
          <xs:documentation xml:lang="EN" source="Desc">Application for quay services</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="A18">
        <xs:annotation>
          <xs:documentation xml:lang="DE" source="Name">Verpflichtungsschein</xs:documentation>
          <xs:documentation xml:lang="EN" source="Name">Certificate of obligation</xs:documentation>
          <xs:documentation xml:lang="DE" source="Desc">Verpflichtungsschein</xs:documentation>
          <xs:documentation xml:lang="EN" source="Desc">Certificate of obligation</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AES">
        <xs:annotation>
          <xs:documentation xml:lang="DE" source="Name">AES-Ausfuhranmeldung</xs:documentation>
          <xs:documentation xml:lang="EN" source="Name">AES export declaration</xs:documentation>
          <xs:documentation xml:lang="DE" source="Desc">AES-Ausfuhranmeldung</xs:documentation>
          <xs:documentation xml:lang="EN" source="Desc">AES export declaration</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AUS">
        <xs:annotation>
          <xs:documentation xml:lang="DE" source="Name">Ausfallkonzept</xs:documentation>
          <xs:documentation xml:lang="EN" source="Name">Outage concept</xs:documentation>
          <xs:documentation xml:lang="DE" source="Desc">Ausfallkonzept</xs:documentation>
          <xs:documentation xml:lang="EN" source="Desc">Outage concept</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="DUX">
        <xs:annotation>
          <xs:documentation xml:lang="DE" source="Name">EAS-Anmeldung</xs:documentation>
          <xs:documentation xml:lang="EN" source="Name">EAS declaration</xs:documentation>
          <xs:documentation xml:lang="DE" source="Desc">EAS-Anmeldung</xs:documentation>
          <xs:documentation xml:lang="EN" source="Desc">EAS declaration</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="EUB">
        <xs:annotation>
          <xs:documentation xml:lang="DE" source="Desc">Europäische Bestimmung</xs:documentation>
          <xs:documentation xml:lang="DE" source="Name">Europäische Bestimmung</xs:documentation>
          <xs:documentation xml:lang="EN" source="Name">European destination</xs:documentation>
          <xs:documentation xml:lang="EN" source="Desc">European destination</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="MIT">
        <xs:annotation>
          <xs:documentation xml:lang="DE" source="Name">Mitteilung</xs:documentation>
          <xs:documentation xml:lang="EN" source="Name">Notification</xs:documentation>
          <xs:documentation xml:lang="DE" source="Desc">Mitteilung</xs:documentation>
          <xs:documentation xml:lang="EN" source="Desc">Notification</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SAC">
        <xs:annotation>
          <xs:documentation xml:lang="DE" source="Name">Sammelcontainer</xs:documentation>
          <xs:documentation xml:lang="EN" source="Name">Consolidated container</xs:documentation>
          <xs:documentation xml:lang="DE" source="Desc">Sammelcontainer</xs:documentation>
          <xs:documentation xml:lang="EN" source="Desc">Consolidated container</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="SBF">
        <xs:annotation>
          <xs:documentation xml:lang="DE" source="Name">sonstige Befreiungstatbestände</xs:documentation>
          <xs:documentation xml:lang="EN" source="Name">Other exemptions</xs:documentation>
          <xs:documentation xml:lang="DE" source="Desc">sonstige Befreiungstatbestände</xs:documentation>
          <xs:documentation xml:lang="EN" source="Desc">Other exemptions</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="TransactionType">
    <xs:sequence>
      <xs:element name="IOPartner" type="an..4">
        <xs:annotation>
          <xs:documentation xml:lang="DE" source="Desc">DAKOSY Teilnehmercode</xs:documentation>
          <xs:documentation xml:lang="EN" source="Desc">DAKOSY participant code</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="IOReference" type="an..35">
        <xs:annotation>
          <xs:documentation xml:lang="DE" source="Desc">Einmalige und eindeutige Transaktionsidentifikationsreferenz</xs:documentation>
          <xs:documentation xml:lang="EN" source="Desc">Unique and unambiguous transaction identification reference</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="IODateTime" type="xs:dateTime">
        <xs:annotation>
          <xs:documentation xml:lang="DE" source="Desc">Datum und Uhrzeit der Nachrichtenerstellung - ISO 8601 Koordinierte Weltzeit (UTC) oder lokale Zeit mit Differenz zu UTC.</xs:documentation>
          <xs:documentation xml:lang="EN" source="Desc">Date and time of message creation - ISO 8601 Coordinated Universal Time (UTC) or local time with offset to UTC.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="MessageVersion" type="an..12">
        <xs:annotation>
          <xs:documentation xml:lang="DE" source="Desc">Verwendete Nachrichtenversion</xs:documentation>
          <xs:documentation xml:lang="EN" source="Desc">Used message version</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="TestIndicator" type="xs:boolean" minOccurs="0">
        <xs:annotation>
          <xs:documentation xml:lang="DE" source="Desc">Testkennzeichen - Gibt an, ob es sich bei der Nachricht um eine Testnachricht handelt. Wenn das Element nicht oder als "true" angegeben wurde, handelt es sich um eine Produktionsnachricht.</xs:documentation>
          <xs:documentation xml:lang="EN" source="Desc">Test indicator - Indicates whether or not the message is a test message. If the element ist not specified or specified as "true", it is about a production message.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:schema>
