<?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

BindingConstraints   | Constraint
  Constraint         | DeviceName, DeviceType, Direction, Limit, Violation, Description, Contingency, TimeOfUse, ShadowPrice
    DeviceName       | n/a
    DeviceType       | n/a
    Direction        | n/a
    Limit            | n/a
    Violation        | n/a
    Description      | n/a
    Contingency      | n/a
    TimeOfUse        | n/a
    ShadowPrice      | n/a

-->

<element name="BindingConstraints">
  <complexType>
    <choice>
      <element name="Constraint" type="CRRDownload:constraintType" minOccurs="0" maxOccurs="unbounded" />
    </choice>
  </complexType>
</element>

<complexType name="constraintType">
  <sequence>
    <element name="ConstraintName" type="string" />
    <element name="Type" type="CRRDownload:bindingDefType" />
    <element name="Direction" type="CRRDownload:directionDefType" />
    <element name="Limit" type="double" />
    <element name="Violation" type="integer" />
    <element name="Contingency" type="string" />
    <element name="TimeOfUse" type="string" />
    <element name="ClearingPrice" type="double" minOccurs="0" />
  </sequence>
</complexType>

<simpleType name="bindingDefType">
  <restriction base="string">
    <enumeration value="LINE" />
    <enumeration value="XFMR" />
    <enumeration value="INTR" />
  </restriction>
</simpleType>

<simpleType name="directionDefType">
  <restriction base="string">
    <enumeration value="FROM_TO"/>
    <enumeration value="TO_FROM"/>
    <enumeration value="POS"/>
    <enumeration value="NEG"/>
  </restriction>
</simpleType>

</schema>
