<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com) by Cheree M Smith (National Library of Australia) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:element name="db_archive">
		<xs:annotation>
			<xs:documentation>Document element. This schema is a draft for describing an arbitrary database supplied for archiving and search purposes. </xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="admin" type="adminType">
					<xs:annotation>
						<xs:documentation>This element contains administrative information about the data collection.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="datamodel" type="datamodelType">
					<xs:annotation>
						<xs:documentation>This element contains the complete data specification for this data collection.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="search_rules" type="search_rulesType" minOccurs="0">
					<xs:annotation>
						<xs:documentation>This element contains instructions for the construction of the search and display interface.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="browse_rules" type="browse_rulesType" minOccurs="0">
					<xs:annotation>
						<xs:documentation>This element contains the list of properties to browse by.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="display_rules" type="display_rulesType" minOccurs="0">
					<xs:annotation>
						<xs:documentation>This element contains configuration options for the display of search (and browse) results.</xs:documentation>
					</xs:annotation>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:complexType name="valuesetType" mixed="true">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:element ref="value"/>
		</xs:choice>
	</xs:complexType>
	<xs:complexType name="propertyType">
		<xs:sequence>
			<xs:element ref="name"/>
			<xs:element ref="composition"/>
			<xs:element ref="obligation"/>
			<xs:element ref="repeatable"/>
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:element ref="label"/>
				<xs:element ref="description"/>
				<xs:element ref="comments"/>
				<xs:element ref="type"/>
				<xs:element name="valueset" type="valuesetType"/>
				<xs:element name="propertygroup">
					<xs:annotation>
						<xs:documentation>This element occurrs only if the composition of this property has been specified as "structured". It contains the set of sub-properties which comprise this property.</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:sequence minOccurs="2" maxOccurs="unbounded">
							<xs:element name="property" type="groupPropertyType"/>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element ref="reference"/>
			</xs:choice>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="groupPropertyType">
		<xs:sequence>
			<xs:element ref="name"/>
			<xs:element ref="obligation"/>
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:element ref="label"/>
				<xs:element ref="definition"/>
				<xs:element ref="comments"/>
				<xs:element ref="type"/>
				<xs:element name="valueset" type="valuesetType"/>
			</xs:choice>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="fieldType" mixed="true">
		<xs:sequence minOccurs="0" maxOccurs="unbounded">
			<xs:element name="subfield" type="xs:NMTOKEN"/>
		</xs:sequence>
		<xs:attribute name="sortorder" default="none">
			<xs:simpleType>
				<xs:restriction base="xs:NMTOKEN">
					<xs:enumeration value="ascending"/>
					<xs:enumeration value="descending"/>
					<xs:enumeration value="none"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="link" default="false">
			<xs:simpleType>
				<xs:restriction base="xs:NMTOKEN">
					<xs:enumeration value="true"/>
					<xs:enumeration value="false"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
	</xs:complexType>
	<xs:element name="composition" default="simple">
		<xs:annotation>
			<xs:documentation>This element records the composition of the item property being described. There a four possible values - "simple" (the property is a literal), "identifier" (the property is a literal but it uniquely identifies the item), "structured" (the property has structure eg has sub-properties, or "reference" (the property is a reference to another item).</xs:documentation>
		</xs:annotation>
		<xs:simpleType>
			<xs:restriction base="xs:NMTOKEN">
				<xs:enumeration value="simple"/>
				<xs:enumeration value="structured"/>
				<xs:enumeration value="reference"/>
				<xs:enumeration value="identifier"/>
			</xs:restriction>
		</xs:simpleType>
	</xs:element>
	<xs:element name="comments" type="xs:string">
		<xs:annotation>
			<xs:documentation>Any further information  that might be of relevance to understanding the contents of this database. This is supplied by the producer.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:complexType name="datamodelType">
		<xs:sequence maxOccurs="unbounded">
			<xs:element name="item" type="itemType">
				<xs:annotation>
					<xs:documentation>This element contains the list of properties which describe a specific type of item which is stored in the database.  A database may contain only one type of item (eg online shop products) or it may contain multiple item types (eg products and suppliers).</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="adminType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:element ref="status"/>
			<xs:element name="archivedate" type="xs:date">
				<xs:annotation>
					<xs:documentation>This is the date (approximate) when the data was supplied by the publisher.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element ref="shortname"/>
			<xs:element ref="title"/>
			<xs:element ref="publisher"/>
			<xs:element ref="liveurl"/>
			<xs:element ref="archiver"/>
			<xs:element ref="description"/>
			<xs:element ref="comments"/>
		</xs:choice>
	</xs:complexType>
	<xs:complexType name="search_rulesType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:element name="search" type="searchType"/>
		</xs:choice>
	</xs:complexType>
	<xs:complexType name="browse_rulesType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:element name="browse" type="browseType"/>
		</xs:choice>
	</xs:complexType>
	<xs:complexType name="browseType">
		<xs:sequence>
			<xs:element name="entity" type="xs:NMTOKEN"/>
			<xs:element ref="label" minOccurs="0"/>
			<xs:element name="field" type="xs:NMTOKEN"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="searchType">
		<xs:sequence>
			<xs:element name="entity" type="xs:NMTOKEN"/>
			<xs:element ref="label" minOccurs="0"/>
			<xs:element name="field" type="fieldType" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="display_rulesType">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:element name="resultsummary" type="summaryType"/>
		</xs:choice>
	</xs:complexType>
	<xs:complexType name="summaryType">
		<xs:sequence>
			<xs:element name="entity" type="xs:NMTOKEN"/>
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:element ref="results-style"/>
				<xs:element ref="results-chunk"/>
				<xs:element name="field" type="fieldType"/>
			</xs:choice>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="detailType">
		<xs:sequence>
			<xs:element name="entity" type="xs:NMTOKEN"/>
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:element name="nulldisplay" type="fieldType"/>
				<xs:element name="private" type="fieldType"/>
			</xs:choice>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="itemType">
		<xs:sequence>
			<xs:element ref="name"/>
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:element ref="label" minOccurs="0"/>
				<xs:element ref="description" minOccurs="0"/>
				<xs:element ref="comments" minOccurs="0"/>
			</xs:choice>
			<xs:choice minOccurs="0" maxOccurs="unbounded">
				<xs:element name="property" type="propertyType"/>
			</xs:choice>
		</xs:sequence>
	</xs:complexType>
	<xs:element name="title" type="xs:string">
		<xs:annotation>
			<xs:documentation>This is the formal title for the data collection. This title 
			 should exactly match the title entry in the PANDAS system.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="liveurl" type="xs:string">
		<xs:annotation>
			<xs:documentation>This is the URL for the live web site to which this database archive is related.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="reference" type="xs:string">
		<xs:annotation>
			<xs:documentation>If a property composition is "reference" then the contents of this element MUST be the same as the name of another type of item which occurrs in this database archive.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="label" type="xs:string">
		<xs:annotation>
			<xs:documentation>Display label for item or property</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="name" type="xs:string">
		<xs:annotation>
			<xs:documentation>This is a single word name for an item or property. It should have a syntax which allows it to be used as an XML element name. It is mandatory.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="obligation" default="optional">
		<xs:annotation>
			<xs:documentation>This element can contain only the following values: mandatory = this property is exists for all item ocurrences; optional = the property is not required to have a value; conditional =  depending on the value of other properties of an item instance, thisproperty may always have a value. These conditions should be documented in the description element.</xs:documentation>
		</xs:annotation>
		<xs:simpleType>
			<xs:restriction base="xs:NMTOKEN">
				<xs:enumeration value="mandatory"/>
				<xs:enumeration value="optional"/>
				<xs:enumeration value="conditional"/>
			</xs:restriction>
		</xs:simpleType>
	</xs:element>
	<xs:element name="publisher" type="xs:string">
		<xs:annotation>
			<xs:documentation>This is the name of the publisher who suuplied the data. It must match a publisher entry in the PANDAS system..</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="archiver" type="xs:string">
		<xs:annotation>
			<xs:documentation>This is the link to the authorised system user who is responsible for archiving this database.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="repeatable" type="xs:boolean" default="false">
		<xs:annotation>
			<xs:documentation>This boolean element indicates whether this property can have multiple ocuccurences for the one item.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="results-chunk" type="xs:nonNegativeInteger">
		<xs:annotation>
			<xs:documentation>This is a positive integer stating the number of search hits that should be returned in each search results chunk. Relevant only for the NLA Application Generator.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="results-style">
		<xs:annotation>
			<xs:documentation>This specifies how the search results are to be formatted.</xs:documentation>
		</xs:annotation>
		<xs:simpleType>
			<xs:restriction base="xs:NMTOKEN">
				<xs:enumeration value="table"/>
				<xs:enumeration value="list"/>
			</xs:restriction>
		</xs:simpleType>
	</xs:element>
	<xs:element name="searchterm" type="xs:boolean" default="false">
		<xs:annotation>
			<xs:documentation>This boolean element is used only by the search interface and specifies whether the 
			search form should present an option to search for a keyword within the contents of this property (form-text), or be able to limit the search 
			to specified values (form=code). It is only relevant for text and code properties. </xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="shortname" type="xs:string">
		<xs:annotation>
			<xs:documentation>This should be a single text string which is the acronym or short name used to reference this data collection. It is assumed that this name will be used in URLs, directory names, oracle schema name etc related to this data collection and its application interface.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="default" type="xs:string">
		<xs:annotation>
			<xs:documentation>A boolean element which states whether this is the code value that should be assumed if none is specified. (is assumed false for all codes and should only be true for one code value if set)</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="defaultvalue" type="xs:string">
		<xs:annotation>
			<xs:documentation>This element contains the default value to be assumed for the property if the value is NULL.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="value" type="xs:string">
		<xs:annotation>
			<xs:documentation>An actual text string that is on of the enumerated values permissable for this property.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="definition" type="xs:string">
		<xs:annotation>
			<xs:documentation>This element contains a semantic definition of the contents of this item property. This is maintained by the producer.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="defsize" type="xs:nonNegativeInteger">
		<xs:annotation>
			<xs:documentation>default size for display</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="description" type="xs:string">
		<xs:annotation>
			<xs:documentation>This is a general description of the archived database, an item or a property. It is semantic information and is supplied by the producer.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="type">
		<xs:annotation>
			<xs:documentation>This is a required element which states the type of data value that is stored for this property if its composition is "simple" or "identifier". Options are: enumeration=this is a text property which has a set of restricted values; identifier=this is a text property which is used as an identifier for an object either inside or outside of this data collection eg an ISBN number, a userid, a trim file number etc; text=a free text property; flag=a boolean property; uri=a text property value which has the form of a URI; date=a property of type date; time=a property of type time; number=a property which has an integer value; realnumber=a property containing a floating point real number value;</xs:documentation>
		</xs:annotation>
		<xs:simpleType>
			<xs:restriction base="xs:NMTOKEN">
				<xs:enumeration value="enumeration"/>
				<xs:enumeration value="identifier"/>
				<xs:enumeration value="text"/>
				<xs:enumeration value="flag"/>
				<xs:enumeration value="url"/>
				<xs:enumeration value="date"/>
				<xs:enumeration value="time"/>
				<xs:enumeration value="number"/>
				<xs:enumeration value="realnumber"/>
				<xs:enumeration value="derived"/>
			</xs:restriction>
		</xs:simpleType>
	</xs:element>
	<xs:element name="status" default="open">
		<xs:annotation>
			<xs:documentation>This element records the current status of the data collection.</xs:documentation>
		</xs:annotation>
		<xs:simpleType>
			<xs:restriction base="xs:NMTOKEN">
				<xs:enumeration value="open"/>
				<xs:enumeration value="closed"/>
			</xs:restriction>
		</xs:simpleType>
	</xs:element>
</xs:schema>

