<?xml version="1.0"?>

<!-- 
   
  XML Schema declaration for AGLS Element Set.
  
  Initial Release
  Date:     2003-09
  Creator:  Duncan Jamieson, National Archives of Australia

  This Version
  Created:  2007-12-12
  Modified: 2008-01-22
  Creator:  David Bromage, National Archives of Australia
  
 -->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns="http://www.agls.gov.au/agls/1.2/"
           targetNamespace="http://www.agls.gov.au/agls/1.2/"
           elementFormDefault="qualified"
           attributeFormDefault="unqualified">

  <xs:annotation>
    <xs:documentation xml:lang="en-AU">
      AGLS XML Schema
      XML Schema for http://www.agls.gov.au/agls/1.2/ namespace

      This schema declares XML elements for the 4 AGLS properties from the
      http://www.agls.gov.au/agls/1.2/ namespace.

      It defines a complexType SimpleLiteral which permits mixed content 
      and makes the xml:lang attribute available. It disallows child elements by
      use of minOcccurs/maxOccurs.

      However, this complexType does permit the derivation of other complexTypes
      which would permit child properties.

      All elements are declared as substitutable for the abstract property any, 
      which means that the default type for all elements is dc:SimpleLiteral.

      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:complexType name="SimpleLiteral">
    <xs:annotation>
      <xs:documentation xml:lang="en-AU">
            This is the default type for all of the AGLS elements.
            It permits text content only with optional
            xml:lang attribute.

            Text is allowed because mixed="true", but sub-elements
            are disallowed because minOccurs="0" and maxOccurs="0" 
            are on the xs:any tag.

    	      This complexType allows for restriction or extension permitting
            child properties.
      </xs:documentation>
    </xs:annotation>

    <xs:complexContent mixed="true">
      <xs:restriction base="xs:anyType">
        <xs:sequence>
         <xs:any processContents="lax" minOccurs="0" maxOccurs="0"/>
        </xs:sequence>
        <xs:attribute ref="xml:lang" use="optional"/>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>

  <xs:property name="any" type="SimpleLiteral" abstract="true"/>

  <xs:property name="availability" substitutionGroup="any"/>
  <xs:property name="function" substitutionGroup="any"/>
  <xs:property name="mandate" substitutionGroup="any"/>

  <!-- Audience retained in schema for legacy resource descriptions using agls:audience -->
  <xs:property name="audience" substitutionGroup="any"/>

  <xs:group name="elementsGroup">
    <xs:annotation>
    	<xs:documentation xml:lang="en-AU">
        This group is included as a convenience for schema authors
        who need to refer to all the elements in the 
        http://www.agls.gov.au/agls/1.2/ namespace.
    	</xs:documentation>
    </xs:annotation>

    <xs:sequence>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:property ref="any"/>
      </xs:choice>
    </xs:sequence>
  </xs:group>

  <xs:complexType name="elementContainer">
    <xs:annotation>
    	<xs:documentation xml:lang="en-AU">
    		This complexType 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="elementsGroup"/>
    </xs:choice>
  </xs:complexType>

</xs:schema>
