<?xml version="1.0"?>

<!-- 
   
  XML Schema declaration for AGLS Terms.
  
  Initial Release
  Date:     2003-09
  Creator:  Duncan Jamieson, National Archives of Australia

  This Version
  Created:  2007-12-12
  Modified: 2008-04-30
  Creator:  David Bromage, National Archives of Australia
  
 -->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:dc="http://purl.org/dc/elements/1.1/"
           xmlns:agls="http://www.agls.gov.au/agls/1.2/"
           targetNamespace="http://www.agls.gov.au/agls/terms/"
           xmlns="http://www.agls.gov.au/agls/terms/"
           elementFormDefault="qualified"
           attributeFormDefault="unqualified">

  <xs:annotation>
    <xs:documentation xml:lang="en">
      AGLSTERMS XML Schema
      XML Schema for http://www.agls.gov.au/agls/terms/ namespace

      This schema declares XML properties for the AGLS properties and
      AGLS encoding schemes from the http://www.agls.gov.au/agls/terms/ namespace.
      
      It reuses the complexType dc:SimpleLiteral, imported from the dc.xsd
      schema, which permits simple property content, and makes the xml:lang
      attribute available.

      This complexType permits the derivation of other complexTypes
      which would permit child elements.

      DC properties are declared as substitutable for the abstract property dc:any, and 
      DC property refinements are defined as substitutable for the base properties 
      which they refine.

      This means that the default type for all XML properties (i.e. all DC and AGLS properties)
      is dc:SimpleLiteral.

      Encoding schemes are defined as complexTypes which are restrictions
      of the dc:SimpleLiteral complexType. These complexTypes restrict 
      values to an appropriates syntax or format using data typing,
      regular expressions, or enumerated lists.
  
      In order to specify one of these encodings an xsi:type attribute must 
      be used in the instance document.

      Also, note that one shortcoming of this approach is that any type can be 
      applied to any of the properties.  There is no convenient way
      to restrict types to specific properties using this approach.

      Copyright Commonwealth of Australia 2007
    </xs:documentation>
  </xs:annotation>

  <xs:import namespace="http://www.w3.org/XML/1998/namespace"
             schemaLocation="http://www.w3.org/2001/03/xml.xsd">
  </xs:import>

   <xs:import namespace="http://purl.org/dc/elements/1.1/"
              schemaLocation="dc.xsd"/>

   <xs:import namespace="http://www.agls.gov.au/agls/1.2/"
              schemaLocation="agls.xsd"/>

   <xs:property name="accessibility" substitutionGroup="any"/>
   <xs:property name="act" substitutionGroup="agls:mandate"/>
   <xs:property name="aggregationLevel" substitutionGroup="dc:type"/>
   <xs:property name="availability" substitutionGroup="any"/>
   <xs:property name="case" substitutionGroup="agls:mandate"/>
   <xs:property name="category" substitutionGroup="dc:type"/>
   <xs:property name="dateLicensed" substitutionGroup="dc:date"/>
   <xs:property name="documentType" substitutionGroup="dc:type"/>
   <xs:property name="function" substitutionGroup="any"/>
   <xs:property name="hasBasis" substitutionGroup="dc:relation"/>
   <xs:property name="isBasisFor" substitutionGroup="dc:relation"/>
   <xs:property name="jurisdiction" substitutionGroup="dc:coverage"/>
   <xs:property name="mandate" substitutionGroup="any"/>
   <xs:property name="protectiveMarking" substitutionGroup="dc:rights"/>
   <xs:property name="regulation" substitutionGroup="agls:mandate"/>
   <xs:property name="serviceType" substitutionGroup="dc:type"/>

  <!-- Syntax Encoding Schemes -->

  <xs:complexType name="AglsAgent">
   <xs:simpleContent>
    <xs:restriction base="dc:SimpleLiteral">
        <xs:simpleType>
          <xs:restriction base="xs:string"/>
        </xs:simpleType>
        <xs:attribute ref="xml:lang" use="prohibited"/>
    </xs:restriction>
   </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="AglsAvail">
   <xs:simpleContent>
    <xs:restriction base="dc:SimpleLiteral">
        <xs:simpleType>
          <xs:restriction base="xs:string"/>
        </xs:simpleType>
        <xs:attribute ref="xml:lang" use="prohibited"/>
    </xs:restriction>
   </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="GOLD">
   <xs:simpleContent>
    <xs:restriction base="dc:SimpleLiteral">
        <xs:simpleType>
          <xs:restriction base="xs:string"/>
        </xs:simpleType>
        <xs:attribute ref="xml:lang" use="prohibited"/>
    </xs:restriction>
   </xs:simpleContent>
  </xs:complexType>


  <!-- Vocabulary Encoding Schemes -->

  <xs:complexType name="AglsJuri">
   <xs:simpleContent>
    <xs:restriction base="dc:SimpleLiteral">
        <xs:simpleType>
          <xs:restriction base="xs:string"/>
        </xs:simpleType>
        <xs:attribute ref="xml:lang" use="prohibited"/>
    </xs:restriction>
   </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="agls-audience">
   <xs:simpleContent>
    <xs:restriction base="dc:SimpleLiteral">
        <xs:simpleType>
          <xs:restriction base="xs:string"/>
        </xs:simpleType>
        <xs:attribute ref="xml:lang" use="prohibited"/>
    </xs:restriction>
   </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="agls-document">
   <xs:simpleContent>
    <xs:restriction base="dc:SimpleLiteral">
        <xs:simpleType>
          <xs:restriction base="xs:string"/>
        </xs:simpleType>
        <xs:attribute ref="xml:lang" use="prohibited"/>
    </xs:restriction>
   </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="agls-service">
   <xs:simpleContent>
    <xs:restriction base="dc:SimpleLiteral">
        <xs:simpleType>
          <xs:restriction base="xs:string"/>
        </xs:simpleType>
        <xs:attribute ref="xml:lang" use="prohibited"/>
    </xs:restriction>
   </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="AGIFT">
   <xs:simpleContent>
    <xs:restriction base="dc:SimpleLiteral">
        <xs:simpleType>
          <xs:restriction base="xs:string"/>
        </xs:simpleType>
        <xs:attribute ref="xml:lang" use="prohibited"/>
    </xs:restriction>
   </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="ANZSCO">
   <xs:simpleContent>
    <xs:restriction base="dc:SimpleLiteral">
        <xs:simpleType>
          <xs:restriction base="xs:string"/>
        </xs:simpleType>
        <xs:attribute ref="xml:lang" use="prohibited"/>
    </xs:restriction>
   </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="ANZSIC">
   <xs:simpleContent>
    <xs:restriction base="dc:SimpleLiteral">
        <xs:simpleType>
          <xs:restriction base="xs:string"/>
        </xs:simpleType>
        <xs:attribute ref="xml:lang" use="prohibited"/>
    </xs:restriction>
   </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="ASGC">
   <xs:simpleContent>
    <xs:restriction base="dc:SimpleLiteral">
        <xs:simpleType>
          <xs:restriction base="xs:string"/>
        </xs:simpleType>
        <xs:attribute ref="xml:lang" use="prohibited"/>
    </xs:restriction>
   </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="APAIS">
   <xs:simpleContent>
    <xs:restriction base="dc:SimpleLiteral">
        <xs:simpleType>
          <xs:restriction base="xs:string"/>
        </xs:simpleType>
        <xs:attribute ref="xml:lang" use="prohibited"/>
    </xs:restriction>
   </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="APT">
   <xs:simpleContent>
    <xs:restriction base="dc:SimpleLiteral">
        <xs:simpleType>
          <xs:restriction base="xs:string"/>
        </xs:simpleType>
        <xs:attribute ref="xml:lang" use="prohibited"/>
    </xs:restriction>
   </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="ASGC">
   <xs:simpleContent>
    <xs:restriction base="dc:SimpleLiteral">
        <xs:simpleType>
          <xs:restriction base="xs:string"/>
        </xs:simpleType>
        <xs:attribute ref="xml:lang" use="prohibited"/>
    </xs:restriction>
   </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="EdNA">
   <xs:simpleContent>
    <xs:restriction base="dc:SimpleLiteral">
        <xs:simpleType>
          <xs:restriction base="xs:string"/>
        </xs:simpleType>
        <xs:attribute ref="xml:lang" use="prohibited"/>
    </xs:restriction>
   </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="Postcode">
   <xs:simpleContent>
    <xs:restriction base="dc:SimpleLiteral">
        <xs:simpleType>
          <xs:restriction base="xs:string"/>
        </xs:simpleType>
        <xs:attribute ref="xml:lang" use="prohibited"/>
    </xs:restriction>
   </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="TAGS">
   <xs:simpleContent>
    <xs:restriction base="dc:SimpleLiteral">
        <xs:simpleType>
          <xs:restriction base="xs:string"/>
        </xs:simpleType>
        <xs:attribute ref="xml:lang" use="prohibited"/>
    </xs:restriction>
   </xs:simpleContent>
  </xs:complexType>

  <xs:group name="elementsAndRefinementsGroup">
    <xs:annotation>
    	<xs:documentation xml:lang="en">
    		This group is included as a convenience for schema authors
            who need to refer to all the AGLS properties
            in the http://www.agls.gov.au/agls/1.2/ and 
            http://www.agls.gov.au/agls/terms namespaces. 
    	</xs:documentation>
    </xs:annotation>

    <xs:sequence>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:property ref="agls:any" />
      </xs:choice>
    </xs:sequence>
  </xs:group>	

  <xs:complexType name="elementOrRefinementContainer">
    <xs:annotation>
    	<xs:documentation xml:lang="en">
    		This is included as a convenience for schema authors who need to define a root
    		or container property for all of the AGLS properties.
    	</xs:documentation>
    </xs:annotation>

    <xs:choice>
      <xs:group ref="elementsAndRefinementsGroup"/>
    </xs:choice>
  </xs:complexType>


</xs:schema>
