<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema version="1.0.1" 
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://ands.org.au/standards/rif-cs/registryObjects"
            targetNamespace="http://ands.org.au/standards/rif-cs/registryObjects"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified">
            
    <xsd:include schemaLocation="registryTypes.xsd"/>

    <xsd:annotation>
        <xsd:documentation xml:lang="en">
            Schema for an ISO2146 collections and services registry Party object.
        </xsd:documentation>
    </xsd:annotation>

    <xsd:element name="party">
       <xsd:annotation>
           <xsd:documentation xml:lang="en">
	           Wrapper element for descriptive and administrative metadata for a party registry object.
           </xsd:documentation>
        </xsd:annotation>

        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="identifier" type="identifierType" minOccurs="0" maxOccurs="unbounded">
                    <xsd:annotation>
                        <xsd:documentation xml:lang="en">
                            Primary and alternative identifiers for a party. The value of the &lt;key&gt; element may be repeated, or any additional (local or global) identifiers described. Each identifier must be represented in its own identifier element.
                        </xsd:documentation>
                    </xsd:annotation>    
                </xsd:element>               

                <xsd:element name="name" type="nameType" minOccurs="0" maxOccurs="unbounded">
                	<xsd:annotation>
                		<xsd:documentation xml:lang="en">
                			The name of the party in either a simple or compound form.
                        </xsd:documentation>
                	</xsd:annotation>
                </xsd:element>

                <xsd:element name="location" type="locationType" minOccurs="0" maxOccurs="unbounded">
                    <xsd:annotation>
                        <xsd:documentation xml:lang="en">
                            Location(s) relevant to the party. A location element should contain information about a single location (e.g. home address).
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:element>

                <xsd:element name="relatedObject" type="relatedObjectType" minOccurs="0" maxOccurs="unbounded">
                    <xsd:annotation>
                        <xsd:documentation xml:lang="en">
                            Element for holding information about a related registry object.
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:element>

                <xsd:element name="subject" type="subjectType" minOccurs="0" maxOccurs="unbounded">
                    <xsd:annotation>
                        <xsd:documentation xml:lang="en">
                            A subject category into which the party falls or the party is related. Multiple subjects must be represented via separate subject elements. 
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:element>
  
                <xsd:element name="description" type="descriptionType" minOccurs="0" maxOccurs="unbounded">
                    <xsd:annotation>
                        <xsd:documentation xml:lang="en">
                            A textual description or URI resolving to a description relevant to the party.
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:element>
                
                <xsd:element name="relatedInfo" type="xsd:anyURI" minOccurs="0" maxOccurs="unbounded">
                    <xsd:annotation>
                        <xsd:documentation xml:lang="en">
                            A URI pointing to information related to the party.
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:element>

            </xsd:sequence>
            
            <xsd:attributeGroup ref="objectAttributes"/>

        </xsd:complexType>
    </xsd:element>

</xsd:schema>