<?xml version="1.0" encoding="UTF-8"?>
<xs:schema 
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    >
  <!-- See also https://wiki.galaxyproject.org/RepositoryDependenciesTagSets
  -->
  <xs:annotation>
    <xs:appinfo>Tool Shed repository_dependencies.xml Schema</xs:appinfo>
    <xs:documentation xml:lang="en">Describes dependencies this repository depends on for things other then tool dependencies.</xs:documentation>
  </xs:annotation>

  <xs:complexType name="Repositories">
    <xs:annotation>
      <xs:documentation xml:lang="en">Collection of repositories.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="repository" type="Repository" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="description" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation xml:lang="en">Description of repositries.</xs:documentation>
      </xs:annotation>
    </xs:attribute>    
  </xs:complexType>

  <xs:complexType name="Repository">
    <xs:annotation>
      <xs:documentation xml:lang="en">Defines a specific revision of a repository on which this repository depends.  If the toolshed is not defined, it will be automatically set to the local Tool Shed.  If defined, the changeset_revision is the minimum required version.  If the changeset_revision is not defined, it will be set to the latest installable changeset_revision for the repository defined by the name and owner.  If either the toolshed or the changeset_revision is not defined, the repository_dependencies.xml file will automatically be altered (before it is committed in the changeset) to include the attributes and values just discussed.</xs:documentation>
    </xs:annotation>
    <xs:attribute name="name" type="xs:string" use="required">
      <xs:annotation>
        <xs:documentation xml:lang="en">Repository name</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="owner" type="xs:string" use="required">
      <xs:annotation>
        <xs:documentation xml:lang="en">Owner of repository</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="toolshed" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation xml:lang="en">Tool Shed containing repository.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="changeset_revision" type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation xml:lang="en">Changeset revision of dependent repository.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="prior_installation_required " type="xs:string" use="optional">
      <xs:annotation>
        <xs:documentation xml:lang="en">Prior installation required.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:element name="repositories" type="Repositories" />
</xs:schema>