<?xml version="1.0" encoding="UTF-8"?>
<!-- DACP Predispatch Energy XML Schema -->
<xs:schema xmlns="http://www.ieso.ca/schema" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ieso.ca/schema" elementFormDefault="qualified">
	<!-- Following stuff is report specific -->
	<xs:include schemaLocation="Document_r1.xsd"/>
	<xs:element name="DocBody">
		<xs:annotation>
			<xs:documentation>Document Body</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="MPShortName" nillable="false">
					<xs:annotation>
						<xs:documentation>Market Participant Short Name</xs:documentation>
					</xs:annotation>
					<xs:simpleType>
						<xs:restriction base="xs:string">
							<xs:minLength value="1"/>
							<xs:maxLength value="12"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:element>
				<xs:element name="DeliveryDate" type="xs:date">
					<xs:annotation>
						<xs:documentation>The Date for which this DACP data applies</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="Resource" maxOccurs="unbounded">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="TiePointID" type="xs:string" minOccurs="0">
								<xs:annotation>
									<xs:documentation>Identification of Market Scheduling Point</xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="ResourceName" type="xs:string">
								<xs:annotation>
									<xs:documentation>Name of Resource as registered with IESO or Boundary Entity</xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="ResourceType" type="xs:string">
								<xs:annotation>
									<xs:documentation>Type of Resource (Generator, Load, Off take, Injection etc.)</xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:sequence>
								<xs:element name="ScheduleEnergies" maxOccurs="unbounded">
									<xs:complexType>
										<xs:sequence>
											<xs:element name="ScheduleTypeID" type="xs:string">
												<xs:annotation>
													<xs:documentation>Identified wether the schedule is Constrained (C) or Unconstrained (U)</xs:documentation>
												</xs:annotation>
											</xs:element>
											<xs:element name="HourlyEnergies">
												<xs:complexType>
													<xs:sequence>
														<xs:element name="HourlyEnergy" type="HourlyValue" maxOccurs="24">
															<xs:annotation>
																<xs:documentation>Amount of Energy Scheduled for the delivery hour</xs:documentation>
															</xs:annotation>
														</xs:element>
													</xs:sequence>
												</xs:complexType>
											</xs:element>
										</xs:sequence>
									</xs:complexType>
								</xs:element>
								<xs:element name="Tags" minOccurs="0" maxOccurs="unbounded">
									<xs:complexType>
										<xs:sequence>
											<xs:element name="Tag" maxOccurs="24">
												<xs:complexType>
													<xs:sequence>
														<xs:element name="DeliveryHour" type="Hour1To24">
															<xs:annotation>
																<xs:documentation>The Hour for which this DACP data applies (1 to 24)</xs:documentation>
															</xs:annotation>
														</xs:element>
														<xs:element name="NercTagID" type="xs:string">
															<xs:annotation>
																<xs:documentation>The NERC Tag ID for intertie transactions</xs:documentation>
															</xs:annotation>
														</xs:element>
													</xs:sequence>
												</xs:complexType>
											</xs:element>
										</xs:sequence>
									</xs:complexType>
								</xs:element>
							</xs:sequence>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<!-- Hourly Value combined Delivery Hour and Energy Value-->
	<xs:complexType name="HourlyValue">
		<xs:sequence>
			<xs:element name="DeliveryHour" type="Hour1To24">
				<xs:annotation>
					<xs:documentation>The Hour for which this data applies (1 to 24)</xs:documentation>
				</xs:annotation>
			</xs:element>
			<!-- Energy MW -->
			<xs:element name="EnergyMW" type="MW_decimal5.1">
				<xs:annotation>
					<xs:documentation>The amount of Energy for this hour</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<!--Decimal MW-->
	<xs:simpleType name="MW_decimal5.1">
		<xs:annotation>
			<xs:documentation>The amount of Energy MW in deciaml</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:decimal">
			<xs:totalDigits value="6"/>
			<xs:fractionDigits value="1"/>
		</xs:restriction>
	</xs:simpleType>
	<!-- Delivery hour indicates hour ending at (1 to 24)-->
	<xs:simpleType name="Hour1To24">
		<xs:annotation>
			<xs:documentation>The Hour for which this data applies (1 to 24)</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:integer">
			<xs:minInclusive value="1"/>
			<xs:maxInclusive value="24"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>
