<?xml version="1.0" encoding="UTF-8"?>

<!-- 
  Variations/FRBR Project schema release 1.1
-->

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

  <!--
    The vFRBR generic entity extension
    -->
  <xsd:complexType name="GenericExtensionsType">
    <xsd:sequence>
      <xsd:any minOccurs="0" maxOccurs="unbounded"
               processContents="lax"/>
    </xsd:sequence>
  </xsd:complexType>

  <!--
    Simple type
    for vFRBR entity attribute XML elements
    -->

  <xsd:complexType name="SimpleAttributeType">
    <xsd:simpleContent>
      <xsd:extension base="xsd:string"/>
    </xsd:simpleContent>
  </xsd:complexType>

  <!--
    Additional attribute types for more complex types
    of vFRBR entity attribute XML elements
    -->

  <!--
    Availability
    -->
  <xsd:simpleType name="AvailabilityAttrType">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="public"/>
      <xsd:enumeration value="private"/>
    </xsd:restriction>
  </xsd:simpleType>

  <!--
    Function
    -->
  <xsd:simpleType name="FunctionAttrType">
    <xsd:restriction base="xsd:string"/>
  </xsd:simpleType>

  <!--
    Jurisdiction
    -->
  <xsd:simpleType name="JurisdictionAttrType">
    <xsd:restriction base="xsd:string"/>
  </xsd:simpleType>

  <!--
    Normal
    -->
  <xsd:simpleType name="NormalAttrType">
    <xsd:restriction base="xsd:string"/>
  </xsd:simpleType>

  <!--
    Offset
    -->
  <xsd:simpleType name="OffsetAttrType">
    <xsd:restriction base="xsd:nonNegativeInteger"/>
  </xsd:simpleType>

  <!--
    Quantitiy
    -->
  <xsd:simpleType name="QuantityAttrType">
    <xsd:restriction base="xsd:nonNegativeInteger"/>
  </xsd:simpleType>

  <!--
    Timeframe
    -->
  <xsd:simpleType name="TimeframeAttrType">
    <xsd:restriction base="xsd:string"/>
  </xsd:simpleType>

  <!--
    Type
    -->
  <xsd:simpleType name="TypeAttrType">
    <xsd:restriction base="xsd:string"/>
  </xsd:simpleType>

  <!--
    Vocabulary
    -->
  <xsd:simpleType name="VocabularyAttrType">
    <xsd:restriction base="xsd:string"/>
  </xsd:simpleType>

  <!--
    Complex types
    for vFRBR entity attribute XML elements
    -->

  <xsd:complexType name="JurisNormalVocabAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="jurisdiction"
                       type="JurisdictionAttrType"
                       use="optional"
                       />
        <xsd:attribute name="normal"
                       type="NormalAttrType"
                       use="optional"
                       />
        <xsd:attribute name="vocabulary"
                       type="VocabularyAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="JurisNormalVocabTimeAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="jurisdiction"
                       type="JurisdictionAttrType"
                       use="optional"
                       />
        <xsd:attribute name="normal"
                       type="NormalAttrType"
                       use="optional"
                       />
        <xsd:attribute name="vocabulary"
                       type="VocabularyAttrType"
                       use="optional"
                       />
        <xsd:attribute name="timeframe"
                       type="TimeframeAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="NormalAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="normal"
                       type="NormalAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="TypeAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="type"
                       type="TypeAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="TypeAvailAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="type"
                       type="TypeAttrType"
                       use="optional"
                       />
        <xsd:attribute name="avail"
                       type="AvailabilityAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="TypeAvailTimeAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="type"
                       type="TypeAttrType"
                       use="optional"
                       />
        <xsd:attribute name="availability"
                       type="AvailabilityAttrType"
                       use="optional"
                       />
        <xsd:attribute name="timeframe"
                       type="TimeframeAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="TypeJurisNormalVocabAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="type"
                       type="TypeAttrType"
                       use="optional"
                       />
        <xsd:attribute name="jurisdiction"
                       type="JurisdictionAttrType"
                       use="optional"
                       />
        <xsd:attribute name="normal"
                       type="NormalAttrType"
                       use="optional"
                       />
        <xsd:attribute name="vocabulary"
                       type="VocabularyAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="TypeJurisNormalVocabTimeAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="type"
                       type="TypeAttrType"
                       use="optional"
                       />
        <xsd:attribute name="jurisdiction"
                       type="JurisdictionAttrType"
                       use="optional"
                       />
        <xsd:attribute name="normal"
                       type="NormalAttrType"
                       use="optional"
                       />
        <xsd:attribute name="vocabulary"
                       type="VocabularyAttrType"
                       use="optional"
                       />
        <xsd:attribute name="timeframe"
                       type="TimeframeAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="TypeJurisVocabAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="type"
                       type="TypeAttrType"
                       use="optional"
                       />
        <xsd:attribute name="jurisdiction"
                       type="JurisdictionAttrType"
                       use="optional"
                       />
        <xsd:attribute name="vocabulary"
                       type="VocabularyAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="TypeNormalAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="type"
                       type="TypeAttrType"
                       use="optional"
                       />
        <xsd:attribute name="normal"
                       type="NormalAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="TypeNormalFunctionAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="type"
                       type="TypeAttrType"
                       use="optional"
                       />
        <xsd:attribute name="normal"
                       type="NormalAttrType"
                       use="optional"
                       />
        <xsd:attribute name="function"
                       type="FunctionAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="TypeNormalVocabAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="type"
                       type="TypeAttrType"
                       use="optional"
                       />
        <xsd:attribute name="normal"
                       type="NormalAttrType"
                       use="optional"
                       />
        <xsd:attribute name="vocabulary"
                       type="VocabularyAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="TypeNormalVocabAvailTimeAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="type"
                       type="TypeAttrType"
                       use="optional"
                       />
        <xsd:attribute name="normal"
                       type="NormalAttrType"
                       use="optional"
                       />
        <xsd:attribute name="vocabulary"
                       type="VocabularyAttrType"
                       use="optional"
                       />
        <xsd:attribute name="availability"
                       type="AvailabilityAttrType"
                       use="optional"
                       />
        <xsd:attribute name="timeframe"
                       type="TimeframeAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="TypeNormalVocabTimeAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="type"
                       type="TypeAttrType"
                       use="optional"
                       />
        <xsd:attribute name="normal"
                       type="NormalAttrType"
                       use="optional"
                       />
        <xsd:attribute name="vocabulary"
                       type="VocabularyAttrType"
                       use="optional"
                       />
        <xsd:attribute name="timeframe"
                       type="TimeframeAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="TypeOffsetAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="type"
                       type="TypeAttrType"
                       use="optional"
                       />
        <xsd:attribute name="offset"
                       type="OffsetAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="TypeTimeAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="type"
                       type="TypeAttrType"
                       use="optional"
                       />
        <xsd:attribute name="timeframe"
                       type="TimeframeAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="TypeVocabAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="type"
                       type="TypeAttrType"
                       use="optional"
                       />
        <xsd:attribute name="vocabulary"
                       type="VocabularyAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="TypeVocabFunctionTimeAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="type"
                       type="TypeAttrType"
                       use="optional"
                       />
        <xsd:attribute name="vocabulary"
                       type="VocabularyAttrType"
                       use="optional"
                       />
        <xsd:attribute name="function"
                       type="FunctionAttrType"
                       use="optional"
                       />
        <xsd:attribute name="timeFrame"
                       type="TimeframeAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="TypeVocabOffsetAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="type"
                       type="TypeAttrType"
                       use="optional"
                       />
        <xsd:attribute name="vocabulary"
                       type="VocabularyAttrType"
                       use="optional"
                       />
        <xsd:attribute name="offset"
                       type="OffsetAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="TypeVocabTimeAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="type"
                       type="TypeAttrType"
                       use="optional"
                       />
        <xsd:attribute name="vocabulary"
                       type="VocabularyAttrType"
                       use="optional"
                       />
        <xsd:attribute name="timeframe"
                       type="TimeframeAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="VocabAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="vocabulary"
                       type="VocabularyAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="VocabNormalAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="vocabulary"
                       type="VocabularyAttrType"
                       use="optional"
                       />
        <xsd:attribute name="normal"
                       type="NormalAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="VocabNormalTimeAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="vocabulary"
                       type="VocabularyAttrType"
                       use="optional"
                       />
        <xsd:attribute name="normal"
                       type="NormalAttrType"
                       use="optional"
                       />
        <xsd:attribute name="timeframe"
                       type="TimeframeAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="VocabQuantAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="vocabulary"
                       type="VocabularyAttrType"
                       use="optional"
                       />
        <xsd:attribute name="quantity"
                       type="QuantityAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="VocabTimeAttributeType">
    <xsd:complexContent>
      <xsd:extension base="SimpleAttributeType">
        <xsd:attribute name="vocabulary"
                       type="VocabularyAttrType"
                       use="optional"
                       />
        <xsd:attribute name="timeframe"
                       type="TimeframeAttrType"
                       use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

</xsd:schema>
