<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:ecl="urn:entsoe.eu:wgedi:codelists" xmlns="urn:iec62325.351:tc57wg16:451-1:acknowledgementdocument:8:1" xmlns:sawsdl="http://www.w3.org/ns/sawsdl" xmlns:cimp="http://www.iec.ch/cimprofile" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="urn:iec62325.351:tc57wg16:451-1:acknowledgementdocument:8:1" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:import schemaLocation="urn-entsoe-eu-wgedi-codelists.xsd" namespace="urn:entsoe.eu:wgedi:codelists" />
  <xs:element name="Acknowledgement_MarketDocument" type="Acknowledgement_MarketDocument" />
  <xs:simpleType name="ID_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#String">
    <xs:restriction base="xs:string">
      <xs:maxLength value="60" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="ESMP_DateTime" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#DateTime">
    <xs:restriction base="xs:dateTime">
      <xs:pattern value="((([0-9]{4})[\-](0[13578]|1[02])[\-](0[1-9]|[12][0-9]|3[01])|([0-9]{4})[\-]((0[469])|(11))[\-](0[1-9]|[12][0-9]|30))T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])Z)|(([13579][26][02468][048]|[13579][01345789](0)[48]|[13579][01345789][2468][048]|[02468][048][02468][048]|[02468][1235679](0)[48]|[02468][1235679][2468][048]|[0-9][0-9][13579][26])[\-](02)[\-](0[1-9]|1[0-9]|2[0-9])T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])Z)|(([13579][26][02468][1235679]|[13579][01345789](0)[01235679]|[13579][01345789][2468][1235679]|[02468][048][02468][1235679]|[02468][1235679](0)[01235679]|[02468][1235679][2468][1235679]|[0-9][0-9][13579][01345789])[\-](02)[\-](0[1-9]|1[0-9]|2[0-8])T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9])Z)" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="PartyID_String-base" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#String">
    <xs:restriction base="xs:string">
      <xs:maxLength value="16" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="PartyID_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#String">
    <xs:simpleContent>
      <xs:extension base="PartyID_String-base">
        <xs:attribute name="codingScheme" type="ecl:CodingSchemeTypeList" use="required" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:simpleType name="MarketRoleKind_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#String">
    <xs:restriction base="ecl:RoleTypeList" />
  </xs:simpleType>
  <xs:simpleType name="ESMPVersion_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#String">
    <xs:restriction base="xs:string">
      <xs:pattern value="[1-9]([0-9]){0,2}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="MessageKind_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#String">
    <xs:restriction base="ecl:MessageTypeList" />
  </xs:simpleType>
  <xs:simpleType name="ProcessKind_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#String">
    <xs:restriction base="ecl:ProcessTypeList" />
  </xs:simpleType>
  <xs:simpleType name="PayloadId_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#String">
    <xs:restriction base="xs:string">
      <xs:maxLength value="150" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="Acknowledgement_MarketDocument" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#MarketDocument">
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" name="mRID" type="ID_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#IdentifiedObject.mRID">
      </xs:element>
      <xs:element minOccurs="1" maxOccurs="1" name="createdDateTime" type="ESMP_DateTime" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#Document.createdDateTime">
      </xs:element>
      <xs:element minOccurs="1" maxOccurs="1" name="sender_MarketParticipant.mRID" type="PartyID_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#IdentifiedObject.mRID">
      </xs:element>
      <xs:element minOccurs="1" maxOccurs="1" name="sender_MarketParticipant.marketRole.type" type="MarketRoleKind_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#MarketRole.type">
      </xs:element>
      <xs:element minOccurs="1" maxOccurs="1" name="receiver_MarketParticipant.mRID" type="PartyID_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#IdentifiedObject.mRID">
      </xs:element>
      <xs:element minOccurs="0" maxOccurs="1" name="receiver_MarketParticipant.marketRole.type" type="MarketRoleKind_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#MarketRole.type">
      </xs:element>
      <xs:element minOccurs="0" maxOccurs="1" name="received_MarketDocument.mRID" type="ID_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#IdentifiedObject.mRID">
      </xs:element>
      <xs:element minOccurs="0" maxOccurs="1" name="received_MarketDocument.revisionNumber" type="ESMPVersion_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#Document.revisionNumber">
      </xs:element>
      <xs:element minOccurs="0" maxOccurs="1" name="received_MarketDocument.type" type="MessageKind_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#Document.type">
      </xs:element>
      <xs:element minOccurs="0" maxOccurs="1" name="received_MarketDocument.process.processType" type="ProcessKind_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#Process.processType">
      </xs:element>
      <xs:element minOccurs="0" maxOccurs="1" name="received_MarketDocument.title" type="PayloadId_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#Document.title">
      </xs:element>
      <xs:element minOccurs="0" maxOccurs="1" name="received_MarketDocument.createdDateTime" type="ESMP_DateTime" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#Document.createdDateTime">
      </xs:element>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="Rejected_TimeSeries" type="TimeSeries" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#MarketDocument.Rejected_TimeSeries">
      </xs:element>
      <xs:element minOccurs="1" maxOccurs="unbounded" name="Reason" type="Reason" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#MarketDocument.Reason">
      </xs:element>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="InError_Period" type="Time_Period" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#MarketDocument.InError_Period">
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:simpleType name="ReasonCode_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#String">
    <xs:restriction base="ecl:ReasonCodeTypeList" />
  </xs:simpleType>
  <xs:simpleType name="ReasonText_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#String">
    <xs:restriction base="xs:string">
      <xs:maxLength value="512" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="Reason" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#Reason">
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" name="code" type="ReasonCode_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#Reason.code">
      </xs:element>
      <xs:element minOccurs="0" maxOccurs="1" name="text" type="ReasonText_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#Reason.text">
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:simpleType name="YMDHM_DateTime" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#DateTime">
    <xs:restriction base="xs:string">
      <xs:pattern value="((([0-9]{4})[\-](0[13578]|1[02])[\-](0[1-9]|[12][0-9]|3[01])|([0-9]{4})[\-]((0[469])|(11))[\-](0[1-9]|[12][0-9]|30))T(([01][0-9]|2[0-3]):[0-5][0-9])Z)|(([13579][26][02468][048]|[13579][01345789](0)[48]|[13579][01345789][2468][048]|[02468][048][02468][048]|[02468][1235679](0)[48]|[02468][1235679][2468][048]|[0-9][0-9][13579][26])[\-](02)[\-](0[1-9]|1[0-9]|2[0-9])T(([01][0-9]|2[0-3]):[0-5][0-9])Z)|(([13579][26][02468][1235679]|[13579][01345789](0)[01235679]|[13579][01345789][2468][1235679]|[02468][048][02468][1235679]|[02468][1235679](0)[01235679]|[02468][1235679][2468][1235679]|[0-9][0-9][13579][01345789])[\-](02)[\-](0[1-9]|1[0-9]|2[0-8])T(([01][0-9]|2[0-3]):[0-5][0-9])Z)" />
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="ESMP_DateTimeInterval" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#DateTimeInterval">
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" name="start" type="YMDHM_DateTime" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#DateTimeInterval.start">
      </xs:element>
      <xs:element minOccurs="1" maxOccurs="1" name="end" type="YMDHM_DateTime" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#DateTimeInterval.end">
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="Time_Period" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#Period">
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" name="timeInterval" type="ESMP_DateTimeInterval" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#Period.timeInterval">
      </xs:element>
      <xs:element minOccurs="1" maxOccurs="unbounded" name="Reason" type="Reason" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#Period.Reason">
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="TimeSeries" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#TimeSeries">
    <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" name="mRID" type="ID_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#IdentifiedObject.mRID">
      </xs:element>
      <xs:element minOccurs="0" maxOccurs="1" name="version" type="ESMPVersion_String" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#TimeSeries.version">
      </xs:element>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="InError_Period" type="Time_Period" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#TimeSeries.InError_Period">
      </xs:element>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="Reason" type="Reason" sawsdl:modelReference="http://iec.ch/TC57/2013/CIM-schema-cim16#TimeSeries.Reason">
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:schema>