<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="group">
		<xs:annotation>
			<xs:documentation>User-defined group</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Name" type="xs:string"/>
			</xs:sequence>
			<xs:attribute name="ID" type="xs:nonNegativeInteger" use="required"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="result">
		<xs:annotation>
			<xs:documentation>Result container for reply from toolkit system</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="resultcode">
					<xs:simpleType>
						<xs:restriction base="xs:string">
							<xs:enumeration value="OK"/>
							<xs:enumeration value="ERROR"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:element>
				<xs:element name="resultcount" type="xs:nonNegativeInteger" minOccurs="0"/>
				<xs:element name="comment" type="xs:string" minOccurs="0"/>
				<xs:element name="version" fixed="$Id: fotopic.xsd,v 1.10 2003-04-10 13:28:02 joel Exp $" minOccurs="0">
					<xs:simpleType>
						<xs:restriction base="xs:string">
							<xs:whiteSpace value="preserve"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:element>
				<xs:element ref="gallery" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element ref="collection" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element ref="photo" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element ref="user" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="gallery">
		<xs:annotation>
			<xs:documentation>gallery container for galleries</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="title" type="xs:string"/>
				<xs:element name="hostname" type="xs:anyURI"/>
				<xs:element ref="collection" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element name="created" type="xs:date"/>
				<xs:element name="skin" type="xs:integer"/>
				<xs:element name="subelements" type="xs:nonNegativeInteger" default="0" minOccurs="0"/>
			</xs:sequence>
			<xs:attribute name="id" type="xs:positiveInteger" use="required"/>
			<xs:attribute name="user" type="xs:positiveInteger" use="required"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="collection">
		<xs:annotation>
			<xs:documentation>Collections container for photos</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="title" type="xs:string"/>
				<xs:element name="copyright" type="xs:string"/>
				<xs:element name="date-start" type="xs:date"/>
				<xs:element name="date-end" type="xs:date" minOccurs="0"/>
				<xs:element name="date-added" type="xs:date" minOccurs="0"/>
				<xs:element name="date-approved" type="xs:date" minOccurs="0"/>
				<xs:element name="rating" type="xs:nonNegativeInteger" default="0" minOccurs="0"/>
				<xs:element name="quicklink" type="xs:string" default="0" minOccurs="0"/>
				<xs:element name="status">
					<xs:simpleType>
						<xs:restriction base="xs:string">
							<xs:enumeration value="Approved"/>
							<xs:enumeration value="Unapproved"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:element>
				<xs:element name="subelements" type="xs:nonNegativeInteger" default="0" minOccurs="0"/>
				<xs:element name="groupid" minOccurs="0" maxOccurs="unbounded">
					<xs:complexType>
						<xs:simpleContent>
							<xs:extension base="xs:nonNegativeInteger">
								<xs:attribute name="id" type="xs:nonNegativeInteger" use="required"/>
							</xs:extension>
						</xs:simpleContent>
					</xs:complexType>
				</xs:element>
				<xs:element ref="photo" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
			<xs:attribute name="id" type="xs:positiveInteger" use="required"/>
			<xs:attribute name="gallery" type="xs:positiveInteger" use="required"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="photo">
		<xs:annotation>
			<xs:documentation>Photograph information</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="filename" type="xs:string"/>
				<xs:element name="description" type="xs:string" minOccurs="0"/>
				<xs:element name="date" type="xs:date"/>
				<xs:element name="hits" type="xs:nonNegativeInteger" minOccurs="0"/>
				<xs:element name="rotate" type="xs:nonNegativeInteger" minOccurs="0"/>
				<xs:element name="password" type="xs:string" minOccurs="0"/>
			</xs:sequence>
			<xs:attribute name="id" type="xs:positiveInteger" use="required"/>
			<xs:attribute name="collection" type="xs:positiveInteger" use="required"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="user">
		<xs:annotation>
			<xs:documentation>Users container for galleries</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="gallery"/>
				<xs:element name="name">
					<xs:simpleType>
						<xs:restriction base="xs:string">
							<xs:whiteSpace value="collapse"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:element>
				<xs:element name="address">
					<xs:simpleType>
						<xs:restriction base="xs:string">
							<xs:whiteSpace value="preserve"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:element>
				<xs:element name="country">
					<xs:simpleType>
						<xs:restriction base="xs:string">
							<xs:length value="2"/>
							<xs:minLength value="2"/>
							<xs:maxLength value="2"/>
							<xs:whiteSpace value="collapse"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:element>
			</xs:sequence>
			<xs:attribute name="id" type="xs:nonNegativeInteger" use="required"/>
		</xs:complexType>
	</xs:element>
</xs:schema>
