<?xml version="1.0" encoding="UTF-8" ?> 

<!--
  Reverse Pricing in XML (RPXML) Schema 1.01

  Copyright (C) Department of Electronic Commerce, Johann Wolfgang Goethe-University. All Rights Reserved.

  Generated On:      2004-05-28 (O. Hinz)
-->

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
	    xmlns:mml="http://www.w3.org/1998/Math/MathML"
            xmlns="urn:RPXML"		
            targetNamespace="urn:RPXML">
<xsd:import namespace="http://www.w3.org/1998/Math/MathML" 
  schemaLocation="http://www.w3.org/Math/XMLSchema/mathml2/mathml2.xsd"/> 

<xsd:element name="reversePricing" type="reversePricing"/>

<xsd:complexType name="reversePricing">
  <xsd:all>
    <xsd:element name="mechanism" type="mechanism" minOccurs="1" maxOccurs="1"/>
    <xsd:element name="maxBids" type="xsd:int" minOccurs="1" maxOccurs="1"/>
    <xsd:element name="thresholdPrice" type="xsd:float" minOccurs="1" maxOccurs="1"/>
    <xsd:element name="notificationDelay" type="xsd:int" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="startingProbability" type="xsd:float" minOccurs="1" maxOccurs="1"/>
    <xsd:element name="lowerBound" type="bound" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="upperBound" type="bound" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="regularPrice" type="bound" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="constraints" type="constraintNode" minOccurs="0" maxOccurs="1"/>  
  </xsd:all>
  <xsd:attribute name="currency" type="xsd:string" use="required"/>
  <xsd:attribute name="timeUnit" type="xsd:string" use="required"/>
</xsd:complexType>


<xsd:complexType name="mechanism">
  <xsd:all>
    <xsd:element name="lists" type="lists" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="listProgression" type="listProgression" minOccurs="0" maxOccurs="1"/>
  </xsd:all>
  <xsd:attribute name="type" use="required">
    <xsd:simpleType>
      <xsd:restriction base="xsd:token">
        <xsd:enumeration value="nameYourPrice"/>
        <xsd:enumeration value="selectYourPrice"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
</xsd:complexType>


<xsd:complexType name="lists">
  <xsd:sequence>
    <xsd:element name="list" type="list" minOccurs="1" maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="list">
  <xsd:sequence>
    <xsd:element name="listItem" type="listItem" minOccurs="1" maxOccurs="unbounded"/>
  </xsd:sequence>
  <xsd:attribute name="type" use="required">
    <xsd:simpleType>
      <xsd:restriction base="xsd:token">
        <xsd:enumeration value="absolutePrices"/>
        <xsd:enumeration value="increments"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="startBidNo" type="xsd:integer" use="required"/>
  <xsd:attribute name="endBidNo" type="xsd:integer" use="optional"/>
</xsd:complexType>

<xsd:complexType name="listItem">
  <xsd:simpleContent>
    <xsd:extension base="xsd:float">
      <xsd:attribute name="id" use="required"/>
    </xsd:extension>
  </xsd:simpleContent>
</xsd:complexType>

<xsd:complexType name="listProgression">
  <xsd:sequence>
    <xsd:element name="listIncrement" type="listIncrement" minOccurs="1" maxOccurs="2"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="listIncrement">
  <xsd:choice>
    <xsd:element name="constant" type="xsd:float"/>
    <xsd:element name="formula" type="formula"/>
  </xsd:choice>  
  <xsd:attribute name="type" use="required">
    <xsd:simpleType>
      <xsd:restriction base="xsd:token">
        <xsd:enumeration value="absolute"/>
        <xsd:enumeration value="relative"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="startBidNo" type="xsd:integer" use="required"/>
  <xsd:attribute name="endBidNo" type="xsd:integer" use="optional"/>
</xsd:complexType>

<xsd:complexType name="bound">
  <xsd:simpleContent>
    <xsd:extension base="xsd:float">
      <xsd:attribute name="visible" use="required">
        <xsd:simpleType>
          <xsd:restriction base="xsd:token">
            <xsd:enumeration value="true"/>
            <xsd:enumeration value="false"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:attribute>
    </xsd:extension>
  </xsd:simpleContent>
</xsd:complexType>

<xsd:complexType name="constraintNode">
  <xsd:sequence maxOccurs="unbounded">
    <xsd:element name="raiseOfThreshold" type="constraint" minOccurs="0"/>
    <xsd:element name="fee" type="constraint" minOccurs="0"/>
    <xsd:element name="minimumIncrement" type="constraint" minOccurs="0"/>
    <xsd:element name="decreaseProbability" type="constraint" minOccurs="0"/>
    <xsd:element name="timeDelay" type="timeConstraint" minOccurs="0"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="constraint">
  <xsd:choice>
    <xsd:element name="constant" type="xsd:float"/>
    <xsd:element name="formula" type="formula"/>
  </xsd:choice>
  <xsd:attribute name="startBidNo" type="xsd:integer" use="optional"/>
  <xsd:attribute name="endBidNo" type="xsd:integer" use="optional"/>
</xsd:complexType>

<xsd:complexType name="timeConstraint">
  <xsd:choice>
    <xsd:element name="constant" type="xsd:integer"/>
    <xsd:element name="formula" type="formula"/>
  </xsd:choice>
  <xsd:attribute name="startBidNo" type="xsd:integer" use="optional"/>
  <xsd:attribute name="endBidNo" type="xsd:integer" use="optional"/>
</xsd:complexType>

<xsd:complexType name="formula">
  <xsd:sequence>
    <xsd:element ref="mml:math"/>
  </xsd:sequence>
</xsd:complexType>

</xsd:schema>
