--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+
+ collectionObjects.rng
+
+ A schema defining the structure of an CollectionObject collection
+ (list of multiple CollectionObjects).
+
+ This schema includes all of its components, rather than referring
+ to them via 'externalRef' references. As such, it can be used as the
+ basis for generating a W3C XML Schema (XSD) schema, via
+ James Clark's Trang utility (http://http://www.thaiopensource.com/relaxng/trang.html).
+ (Trang version 20081028 can't resolve such references.)
+
+ As a convenience, a 'rng-to-xsd.sh' script file, which trivially wraps Trang
+ to generate XSD from a RELAX NG schema, is provided elsewhere in this distribution.
+
+ This schema was created for the CollectionSpace system,
+ http://www.collectionspace.org/
+
+ It is written in the XML syntax of the RELAX NG schema language,
+ http://relaxng.org/
+
+ $Author: aron $
+ $Revision: 57 $
+ $Date: 2009-03-05 16:06:06 -0800 (Thu, 05 Mar 2009) $
+
+-->
+
+<element
+ name="collectionObjects"
+ ns="http://collectionspace.org/hello"
+ xmlns="http://relaxng.org/ns/structure/1.0"
+ datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+
+ <!--
+ Sanjay's used a different naming convention in the Person prototype,
+ which would be equivalent here to "collection-object-list-item".
+
+ We may want to standardize on use of CamelCase or hyphenated lowercase throughout, or
+ else establish a convention for list items which is distinct from that convention.
+ -->
+
+ <zeroOrMore>
+
+ <element
+ name="collectionObjectListItem">
+
+ <element name="collectionSpaceId">
+ <data type="string" />
+ </element>
+
+ <element name="objectNumber">
+ <data type="normalizedString">
+ <param name="minLength">1</param>
+ </data>
+ </element>
+
+ <element name="objectName">
+ <choice>
+ <data type="string" />
+ <empty />
+ </choice>
+ </element>
+
+ <element name="uri">
+ <data type="anyURI" />
+ </element>
+
+ </element>
+
+ </zeroOrMore>
+
+</element>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+
+ collectionObjects.xml
+
+ A hypothetical, skeletal instance of an CollectionObjects list payload,
+ represented as an XML document, in a rudimentary root namespace,
+ scoped for the Release 0.1 "Hello World" demo.
+
+ This is created for the CollectionSpace system, http://www.collectionspace.org/
+
+ $Author: aron $
+ $Revision: 509 $
+ $Date: 2008-10-27 13:55:56 -0700 (Mon, 27 Oct 2008) $
+
+-->
+
+<collectionObjects
+ xmlns="http://collectionspace.org/hello">
+
+ <collectionObjectListItem>
+ <collectionSpaceId>org.collectionspace.797220effa5fa160</collectionSpaceId>
+ <objectNumber>1984.021.0049</objectNumber>
+ <objectName>Radio News, vol. 10, no. 2, August 1928</objectName>
+ <uri>/collectionObjects/1984.021.0049</uri>
+ </collectionObjectListItem>
+
+ <collectionObjectListItem>
+ <collectionSpaceId>org.collectionspace.68ac7dc8f9e743</collectionSpaceId>
+ <objectNumber>1997.005.0437</objectNumber>
+ <objectName>Toy, Gotham City Police Helicopter, 1992</objectName>
+ <uri>/collectionObjects/1997.005.0437</uri>
+ </collectionObjectListItem>
+
+</collectionObjects>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+elementFormDefault="qualified"
+targetNamespace="http://collectionspace.org/hello"
+xmlns="http://collectionspace.org/hello">
+ <xs:element name="collectionObjects">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="collectionObjectListItem"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="collectionObjectListItem">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="collectionSpaceId"/>
+ <xs:element ref="objectNumber"/>
+ <xs:element ref="objectName"/>
+ <xs:element ref="uri"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="collectionSpaceId" type="xs:string"/>
+ <xs:element name="objectNumber">
+ <xs:simpleType>
+ <xs:restriction base="xs:normalizedString">
+ <xs:minLength value="1"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="objectName">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:string">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="uri" type="xs:anyURI"/>
+</xs:schema>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xs:schema
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns="http://collectionspace.org/hello"
+ xmlns="http://collectionspace.org/hello"
+ targetNamespace="http://collectionspace.org/hello"
+ version="0.1"
+>
+
+ <!--
+ Including multiple schemas via an 'include' directive here does work,
+ but results in duplicate declarations for several data elements.
+
+ As a workaround, both schemas are included in full here. Several
+ child elements of collectionObject (a single entity) are merely
+ referenced from within collectionObjects (a list).
+ -->
+
+ <!-- xs:include schemaLocation="collectionObject-ns-no-prefix.xsd"/ -->
+ <!-- xs:include schemaLocation="collectionObjects.xsd"/ -->
+
+ <!--
+ Sanjay noted:
+ avoid XmlRootElement nightnmare, see
+ http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html
+ -->
+
+ <xs:element name="collectionObject">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="serviceMetadata"/>
+ <xs:element ref="defaultCollectionObject"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="serviceMetadata">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="collectionSpaceId"/>
+ <xs:element minOccurs="0" ref="created"/>
+ <xs:element minOccurs="0" ref="createdBy"/>
+ <xs:element minOccurs="0" ref="lastModified"/>
+ <xs:element minOccurs="0" ref="lastModifiedBy"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="collectionSpaceId" type="xs:string"/>
+ <xs:element name="created">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:dateTime">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="createdBy">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:string">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="lastModified">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:dateTime">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="lastModifiedBy">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:string">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="defaultCollectionObject">
+ <xs:complexType>
+ <xs:all>
+ <xs:element ref="objectNumber"/>
+ <xs:element minOccurs="0" ref="otherNumber"/>
+ <xs:element minOccurs="0" ref="briefDescription"/>
+ <xs:element minOccurs="0" ref="comments"/>
+ <xs:element minOccurs="0" ref="distinguishingFeatures"/>
+ <xs:element minOccurs="0" ref="objectName"/>
+ <xs:element minOccurs="0" ref="responsibleDepartment"/>
+ <xs:element minOccurs="0" ref="title"/>
+ </xs:all>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="objectNumber">
+ <xs:simpleType>
+ <xs:restriction base="xs:normalizedString">
+ <xs:minLength value="1"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="otherNumber">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:string">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="briefDescription">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:string">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="comments">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:string">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="distinguishingFeatures">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:string">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="objectName">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:string">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="responsibleDepartment">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:string">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="title">
+ <xs:simpleType>
+ <xs:union memberTypes="xs:string">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:element>
+
+ <xs:element name="collectionObjects">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="collectionObjectListItem"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <!--
+ Note CamelCase here; Sanjay uses the style "collection-object-list-item", and
+ we can and should revert to that if needed.
+ -->
+ <xs:element name="collectionObjectListItem">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="collectionSpaceId"/>
+ <xs:element ref="objectNumber"/>
+ <xs:element ref="objectName"/>
+ <xs:element ref="uri"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="uri" type="xs:anyURI"/>
+
+</xs:schema>
+