<?xml version="1.0" encoding="ISO-8859-1"?>

<schema targetNamespace="http://crr.caiso.org/download/xml" 
        xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:CRRDownload="http://crr.caiso.org/download/xml"
        attributeFormDefault="qualified"
        elementFormDefault="qualified">

<!--
Element Name         | Allowed Nested Elements

MarketResults        | Result
  Result             | CRRID, Category, MarketParticipant, AssetOwner, Source, Sink, HedgeType, CRRType, TimeOfUse, MW
    CRRID            | n/a
    Category         | n/a
    MarketParticipant| n/a
    AssetOwner       | n/a
    Source           | n/a
    Sink             | n/a
    HedgeType        | n/a
    CRRType     	 | n/a
    TimeOfUse        | n/a
    MW               | n/a


-->

<element name="MarketResults">
  <complexType>
    <choice>
      <element name="Result" type="CRRDownload:resultDefType" minOccurs="0" maxOccurs="unbounded" />
    </choice>
  </complexType>
</element>

<complexType name="resultDefType">
  <sequence>
    <element minOccurs="0" name="CRRID" type="long" />
    <element minOccurs="0" name="Category" type="CRRDownload:categoryDefType" />
    <element name="MarketParticipant" type="string" />
    <element minOccurs="0" name="Source" type="string" />
    <element minOccurs="0" name="Sink" type="string" />
    <element name="StartDate" type="date" />
    <element name="EndDate" type="date" />   
    <element name="HedgeType" type="CRRDownload:hedgeDefType" />
    <element name="CRRType" type="string" />
    <element name="Type" type="string" />
    <element name="TimeOfUse" type="string" />
    <element name="MW" type="double" />
    <element minOccurs="0" name="ClearingPrice" type="double" />
  </sequence>
</complexType>

<simpleType name="hedgeDefType">
  <restriction base="string">
    <enumeration value="OPT" />
    <enumeration value="OBL" />
  </restriction>
</simpleType>

<simpleType name="categoryDefType">
  <restriction base="string">
    <enumeration value="PTP" />
    <enumeration value="NSR" />
  </restriction>
</simpleType>


</schema>
