<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
	   xmlns:vid="http://www.ivoa.net/xml/prop/VOIdentifier"
           targetNamespace="http://www.ivoa.net/xml/prop/VOIdentifier"
           elementFormDefault="qualified" attributeFormDefault="unqualified">

  <xs:annotation>
    <xs:documentation>Version 0.1</xs:documentation>
    <xs:documentation>
      This schema defines the XML format for IVOA Identifiers as
      specified in the IVOA Identifiers Working Draft, Version 0.1.
    </xs:documentation>
    <xs:documentation>
      History:
    </xs:documentation>
  </xs:annotation>

  <xs:element name="Identifier" type="vid:IVOAidentifier">
    <xs:annotation>
      <xs:documentation>
        a global, IVOA-compliant identifier that refers
	unambiguously to a resource.
      </xs:documentation>
    </xs:annotation>
  </xs:element>

  <xs:complexType name="IVOAidentifier">
    <xs:sequence>
      <xs:element ref="vid:AuthorityID" />
      <xs:element ref="vid:ResourceKey" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

  <xs:element name="AuthorityID" type="vid:AuthorityIDType">
    <xs:annotation>
      <xs:documentation>the identifier a namespace under the control of
         a single naming authority</xs:documentation>
    </xs:annotation>
  </xs:element>

  <xs:element name="ResourceKey" type="vid:ResourceKeyType">
    <xs:annotation>
      <xs:documentation>the identifier a namespace under the control of
         a single naming authority</xs:documentation>
    </xs:annotation>
  </xs:element>

  <xs:simpleType name="AuthorityIDType">
    <xs:restriction base="xs:string">
      <xs:pattern value="[\w\d][\w\d\-_\.!~\*'\(\)]{2}"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="ResourceKeyType">
    <xs:restriction base="xs:string">
      <xs:pattern value="[\w\d\-_\.!~\*'\(\)]+(/[\w\d\-_\.!~\*'\(\)])*"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="IVOAIdentifierURI">
    <xs:restriction base="xs:anyURI">
      <xs:pattern value="ivo://[\w\d][\w\d\-_\.!~\*'\(\)]{2}(/[\w\d\-_\.!~\*'\(\)]+(/[\w\d\-_\.!~\*'\(\)])*)"/>
    </xs:restriction>
  </xs:simpleType>

</xs:schema>


