<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <!-- ############### Description of XML Schema ################# -->
  <xsd:annotation>
    <xsd:documentation xml:lang="en">
      Album Shaper 1.1 XML schema
      (Used with Album Shaper version 1.0a3+)
      Copyright 2003 Will Stokes
     http://albumshaper.sourceforge.net
     wstokes@gingi.uchicago.edu
    </xsd:documentation>
  </xsd:annotation>

  <!-- ########### Top Level Album element and it's Description ####### -->
  <xsd:element name="album" type="albumType"/>
 
  <xsd:complexType name="albumType">
    <xsd:sequence>
      <xsd:element name="name"         type="xsd:string"/>
      <xsd:element name="description" type="xsd:string"/>
      <xsd:element name="author"       type="xsd:string"/>
      <xsd:element name="created"     type="albumDateType"/>
      <xsd:element name="modified"    type="albumDateType"/>
      <xsd:element name="theme"       type="xsd:string"/>
      <xsd:element name="thumbnailDimensions" type="dimensionsType"/>
      <xsd:element name="slideshowDimensions" type="dimensionsType"/>
      <xsd:element name="thumb" type="thumbType"/ minOccurs="0" maxOccurs="1">
      <xsd:element name="subalbum"  type="subalbumType" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:sequence>
    <xsd:attribute name="version" type="xsd:string"/>
  </xsd:complexType>
   
  <!-- ##################### Album modified date ################# -->
  <xsd:simpleType name="albumDateType">
    <xsd:restriction base="xsd:string">
      <xsd:pattern value="\d{4} \d{1,2} \d{1,2}"/>
    </xsd:restriction>
  </xsd:simpleType>
   
  <!-- ## Dimensions type, specifies resolution thumbs and slideshow images are save in## -->
  <xsd:simpleType name="dimensionsType">
    <xsd:restriction base="xsd:string">
      <xsd:pattern value="\d{1,} \d{1,}"/>
    </xsd:restriction>
  </xsd:simpleType>
  
  <!-- ########### Thum type, used for albums and subalbums ########## -->
  <xsd:simpleType name="thumbType">
    <xsd:attribute name="path" type="xsd:string"/>
  </xsd:simpleType>
    
  <!-- ##################### Subalbums ######################### -->
  <xsd:complexType name="subalbumType">
    <xsd:sequence>
      <xsd:element name="name" type="xsd:string"/>
      <xsd:element name="description" type="xsd:string"/>
      <xsd:element name="thumb" type="thumbType"/ minOccurs="0" maxOccurs="1">
      <xsd:element name="photo" type="photoType" minOccurs="0" maxOccurs="unbounded"/>  
    </xsd:sequence>
  </xsd:complexType>

  <!-- ######################## Photos ######################### -->
  <xsd:complexType name="photoType">
     <xsd:sequence>
       <xsd:element name="description" type="xsd:string"/>
       <xsd:element name="image" type="imageInfo"/>
       <xsd:element name="slideshow" type="imageInfo"/>
       <xsd:element name="thumb" type="imageInfo"/>
     </xsd:sequence>
  </xsd:complexType>

  <!-- #############  Thumb/Slide/Full image into ################### -->
  <xsd:complexType name="imageInfo">
    <xsd:sequence>
      <xsd:element name="md5" type="xsd:string"/>      
      <xsd:element name="modified" type="photoDateType"/>
    </xsd:sequence>
  </xsd:complexType>

  <!-- #####  Image file date (YYYY MM DD HH MM SS MM ########## -->
  <xsd:simpleType name="photoDateType">
    <xsd:restriction base="xsd:string">
      <xsd:pattern value="\d{4} \d{1,2} \d{1,2} \d{1,2} \d{1,2} \d{1,2} \d{1,2}"/>
    </xsd:restriction>
  </xsd:simpleType>
    
</xsd:schema>
 
