<?xml version="1.0" encoding="UTF-8"?>
<xs:schema 
  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
  xmlns:vr="http://www.ivoa.net/xml/VOResource/v1.0" 
  xmlns:vs="http://www.ivoa.net/xml/VODataService/v1.1" 
  xmlns:vm="http://www.ivoa.net/xml/VOMetadata/v0.1" 
  xmlns:doc="http://www.ivoa.net/xml/DocRegExt/v1.0"
  version="1.0note"
  targetNamespace="http://www.ivoa.net/xml/DocRegExt/v1" 
  elementFormDefault="unqualified" 
  attributeFormDefault="unqualified" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <xs:annotation>
  <xs:appinfo>
    <vm:schemaName>DocRegExt</vm:schemaName>
    <vm:schemaPrefix>xs</vm:schemaPrefix>
    <vm:targetPrefix>doc</vm:targetPrefix>
  </xs:appinfo>
  <xs:documentation>
  A description of a document/education-like resource.
  </xs:documentation>
  </xs:annotation>
  <xs:import namespace="http://www.ivoa.net/xml/VOResource/v1.0" 
  	schemaLocation="http://docs.g-vo.org/schemata/VOResource.xsd"/>
  <xs:import namespace="http://www.ivoa.net/xml/VODataService/v1.1" 
  	schemaLocation="http://docs.g-vo.org/schemata/VODataService.xsd"/>

  <xs:complexType name="Document">
    <xs:annotation>
      <xs:documentation>
      A natural-language document.
      </xs:documentation>
      <xs:documentation>
        Natual-language documents suitable for registration include
        worked-out use cases, tutorials, courses, or even material like
        reference cards, provided they cover Virtual Observatory techniques.

        We consider all translations of a document as one resource.
        Individual translations are defined as doc:DocFile-typed 
        capabilities.
      </xs:documentation>
    </xs:annotation>

    <xs:complexContent>
      <xs:extension base="vs:CatalogService"/>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Edition">
    <xs:annotation>
      <xs:documentation>
        An “edition” (typically: translation) of the document.
      </xs:documentation>
      <xs:documentation>
        Although for a while, multiple editions of the document in one language
        may be given (corresponding perhaps to two “major” versions), in
        general, only the latest version of the document per language should be
        given.

        At least one vr:WebBrowser-typed interface with 
        role="rendered" must be present. The access URL of the interface
        points to a rendered version of the edition (preferably in PDF, 
        but HTML is acceptable, too).

        Editors are strongly encourated to also provide an 
        interface with role="source", the accessURL of which should point
        to an editable version of the document, a version controlled
        repository, or the like.
      </xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="vr:Capability">
        <xs:sequence>
          <xs:element name="languageCode" type="xs:token"
            minOccurs="1" maxOccurs="1">
            <xs:annotation>
              <xs:documentation>
                The language this document is (mainly) written in,
                as an RFC 3066 language code.
              </xs:documentation>
              <xs:documentation>
                The country codes must be given in all lowercase.  This
                results in strings like en-us, de-de, or es-mx.

                This language is also the language for locTitle, 
                irrespective or that element's xml:lang setting.
              </xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="locTitle" type="xs:token"
            minOccurs="0" maxOccurs="1">
            <xs:annotation>
            	<xs:documentation>
              	The translated document's title in the language specified
              	by the language sibling.
            	</xs:documentation>
            	<xs:documentation>
              	It is recommended to set this element's xml:lang element
              	to the same value as the language sibling.  The reason
              	xml:lang is not used in the first place is that with an
              	extra element, enforcing that the content language is
              	given is more straightforward.
              </xs:documentation>
            </xs:annotation>
          </xs:element>
       </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>
