<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns="http://cdk.sf.net/schema/changelog"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://cdk.sf.net/schema/changelog"
  elementFormDefault="qualified">

   <xsd:attributeGroup name="changeGrp">
     <xsd:attribute name="contributor" type="contributorListType" default="unknown"/>
     <xsd:attribute name="date" type="xsd:date" use="optional"/>
   </xsd:attributeGroup>

  <xsd:simpleType name="contributorType">
    <xsd:restriction base="xsd:string">
      <!-- This is a alphabetical list of contributors to CDK.
           The id's used are (if possible) the SF accounts. -->
      
      <xsd:enumeration value="chhoppe"/>        <!-- Christian Hoppe <c.hoppe_@web.de> -->
      <xsd:enumeration value="cpudney"/>    <!-- Chris Pudney <cpudney@users.sf.net> -->
      <xsd:enumeration value="egonw"/>      <!-- Egon Willighagen <e.willighagen@science.ru.nl> -->
      <xsd:enumeration value="irilenia"/>   <!-- Irilenia Nobeli <nobeli@ebi.ac.uk> -->
      <xsd:enumeration value="meklund"/>    <!-- Martin Eklund <martin.eklund@farmbio.uu.se> -->
      <xsd:enumeration value="shk3"/>       <!-- Stefan Kuhn <stefan.kuhn@uni-koeln.de> -->
      <xsd:enumeration value="steinbeck"/>  <!-- Christoph Steinbeck <c.steinbeck@uni-koeln.de> -->
      <xsd:enumeration value="thanser"/>    <!-- Thierry Hanser <thierry.hanser@ixelis.com> -->
      <xsd:enumeration value="tohel"/>      <!-- Tobias Helmus <tobias.helmus@uni-koeln.de> -->
      <xsd:enumeration value="ulif"/>       <!-- Uli Fechner <u.fechner@chemie.uni-frankfurt.de> -->
      
      
      <!-- Contributor was untracable -->
      <xsd:enumeration value="unknown"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="closesType">
    <xsd:list itemType="xsd:positiveInteger"/>
  </xsd:simpleType>
  
  <xsd:simpleType name="contributorListType">
    <xsd:list itemType="contributorType"/>
  </xsd:simpleType>
  
  <xsd:element name="changelog">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="release" minOccurs="1" maxOccurs="unbounded"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="release">
    <xsd:complexType>
      <xsd:sequence minOccurs="0" maxOccurs="unbounded">
        <xsd:choice>
          <xsd:element ref="addition" />
          <xsd:element ref="bugfix"   />
          <xsd:element ref="apiChange"/>
        </xsd:choice>
      </xsd:sequence>
      <xsd:attribute name="id" type="xsd:string" use="required"/>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="addition">
    <xsd:complexType>
      <xsd:simpleContent>
        <xsd:extension base="xsd:string">
          <xsd:attributeGroup ref="changeGrp"/>
          <xsd:attribute name="implements" type="closesType" use="optional"/>
        </xsd:extension>
      </xsd:simpleContent>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="bugfix">
    <xsd:complexType>
      <xsd:simpleContent>
        <xsd:extension base="xsd:string">
          <xsd:attributeGroup ref="changeGrp"/>
          <xsd:attribute name="closes" type="closesType" use="optional"/>
        </xsd:extension>
      </xsd:simpleContent>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="apiChange">
    <xsd:complexType>
      <xsd:simpleContent>
        <xsd:extension base="xsd:string">
          <xsd:attributeGroup ref="changeGrp"/>
          <xsd:attribute name="implements" type="closesType" use="optional"/>
          <xsd:attribute name="closes" type="closesType" use="optional"/>
        </xsd:extension>
      </xsd:simpleContent>
    </xsd:complexType>
  </xsd:element>

</xsd:schema>
