<?xml version = "1.0"?>

<!-- 
   
  XML Schema declaration for AGLS Availability Syntax Encoding Scheme.
  
  Initial Release
  Date:     2003-09
  Author:   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/terms/AglsAvail"
           targetNamespace="http://www.agls.gov.au/agls/terms/"
           elementFormDefault="qualified"
           attributeFormDefault="unqualified">

<xs:annotation>
  <xs:documentation xml:lang="en-AU">
    This document defines the AGLS Availability Syntax Encoding Scheme, which is used
    in the schema definition for AGLS metadata.

    Copyright Commonwealth of Australia 2003
  </xs:documentation>
</xs:annotation>

<!-- Include references to externally defined types used by this schema.
They are defined externally to ensure that any new types can be added 
without changing the core essence of this schema -->

<xs:import namespace="http://www.agls.gov.au/agls/terms/"
           schemaLocation="AglsJuri.xsd"/>

<xs:complexType name="AglsAvail">
  <xs:sequence>

    <xs:element name="personalName" minOccurs="0">
      <xs:annotation>
        <xs:documentation xml:lang="en-AU">The name of a person making the resource available or providing access to the resource</xs:documentation>
      </xs:annotation>
    </xs:element>

    <xs:element name="corporateName" type="xs:string" minOccurs="0" maxOccurs="unbounded">
      <xs:annotation>
        <xs:documentation xml:lang="en-AU">The name of an organisation making the resource available or providing access to the resource.</xs:documentation>
      </xs:annotation>
    </xs:element>

    <xs:element name="jurisdiction" type="AglsJuri" minOccurs="0" maxOccurs="unbounded">
      <xs:annotation>
        <xs:documentation xml:lang="en-AU">The legal jurisdiction of the organisation making the resource available or providing access. NB values for this component must be drawn from the AGLS Jurisdiction controlled list.</xs:documentation>
      </xs:annotation>
    </xs:element>

    <xs:element name="contact" type="xs:string" minOccurs="0" maxOccurs="unbounded">
      <xs:annotation>
        <xs:documentation xml:lang="en-AU">Contact details for the person or organisation making ghe resource available or providing access. Can include an official title. Typically includes a phone number.</xs:documentation>
      </xs:annotation>
    </xs:element>

    <xs:element name="address" type="xs:string" minOccurs="0" maxOccurs="unbounded">
      <xs:annotation>
        <xs:documentation xml:lang="en-AU">Street or postal address for the person or organisation making the resource available or providing access.</xs:documentation>
      </xs:annotation>
    </xs:element>

    <xs:element name="email" minOccurs="0" maxOccurs="unbounded">
      <xs:annotation>
        <xs:documentation xml:lang="en-AU">An email address for the person or organisation making ghe resource available or providing access.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$ "/>
        </xs:restriction>
      </xs:simpleType>
    </xs:element>

    <xs:element name="hours" minOccurs="0" maxOccurs="unbounded">
      <xs:annotation>
        <xs:documentation xml:lang="en-AU">The hours during which access to the resource or contact person can occur.</xs:documentation>
      </xs:annotation>
    </xs:element>

    <xs:element name="cost" type="xs:string" minOccurs="0" maxOccurs="unbounded">
      <xs:annotation>
        <xs:documentation xml:lang="en-AU">Indicates the cost of obtaining the resource or access to the resource.</xs:documentation>
      </xs:annotation>
    </xs:element>

    <xs:element name="postcode" type="xs:string" minOccurs="0" maxOccurs="unbounded">
      <xs:annotation>
        <xs:documentation xml:lang="en-AU">The postcode(s) of the locations at which the resource can be accessed, or is made available.</xs:documentation>
      </xs:annotation>
    </xs:element>

  </xs:sequence>
</xs:complexType>

</xs:schema>
