<?xml version = "1.0" encoding = "UTF-8"?>
<!-- style sheet OFF -->
<!--
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    #
    # Copyright (C) 2003-2011 Open Microscopy Environment
    #       Massachusetts Institute of Technology,
    #       National Institutes of Health,
    #       University of Dundee,
    #       University of Wisconsin at Madison
    #
    # This work is licensed under the
    #       Creative Commons Attribution 3.0 Unported License.
    # To view a copy of this license, visit
    #       http://creativecommons.org/licenses/by/3.0/
    # or send a letter to
    #       Creative Commons, 444 Castro Street, Suite 900,
    #       Mountain View, California, 94041, USA.
    # For attribution instructions, visit
    #       http://www.openmicroscopy.org/info/attribution
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<!--
	#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	# Written by:  Andrew J Patterson 
	#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<xsd:schema xmlns = "http://www.openmicroscopy.org/Schemas/OMERO/2011-06"
	targetNamespace = "http://www.openmicroscopy.org/Schemas/OMERO/2011-06"
	xmlns:OME = "http://www.openmicroscopy.org/Schemas/OME/2011-06"
	xmlns:xsd = "http://www.w3.org/2001/XMLSchema"
	version = "1"
	elementFormDefault = "qualified">

	<xsd:import namespace="http://www.openmicroscopy.org/Schemas/OME/2011-06" schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2011-06/ome.xsd"/>

	<xsd:element name="ProfileSet"> <!-- top level definition -->
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="ImageProfile" minOccurs="0" maxOccurs="2">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:element name="Name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
							<xsd:element name="Description" minOccurs="0" maxOccurs="1">
								<xsd:annotation>
									<xsd:documentation>
										A description for the image profile.
									</xsd:documentation>
								</xsd:annotation>
								<xsd:simpleType>
									<xsd:restriction base="xsd:string">
										<xsd:whiteSpace value="preserve"/>
									</xsd:restriction>
								</xsd:simpleType>
							</xsd:element>
							<!-- InstrumentRef is used instead of a reference to Microscope as 
								there is no ID in Microscope. There is a 1 to 1 mapping as each
								Instrument can contain only 1 Microscope.
							-->
							<xsd:element ref="OME:InstrumentRef" minOccurs="0" maxOccurs="1"/>
							<xsd:element ref="OME:ObjectiveSettings" minOccurs="0" maxOccurs="1"/>
						</xsd:sequence>
						<xsd:attribute name="origin" use="optional" type="ProfileSource"/>
					</xsd:complexType>
				</xsd:element>
				<xsd:element name="ChannelProfile" minOccurs="0" maxOccurs="2">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:element name="Name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
							<xsd:element name="Description" minOccurs="0" maxOccurs="1">
								<xsd:annotation>
									<xsd:documentation>
										A description for the channel profile.
									</xsd:documentation>
								</xsd:annotation>
								<xsd:simpleType>
									<xsd:restriction base="xsd:string">
										<xsd:whiteSpace value="preserve"/>
									</xsd:restriction>
								</xsd:simpleType>
							</xsd:element>
							<xsd:element ref="OME:LightSourceSettings" minOccurs="0" maxOccurs="1"/>
							<xsd:element ref="OME:OTFRef" minOccurs="0" maxOccurs="1"/>
							<xsd:element ref="OME:DetectorSettings" minOccurs="0" maxOccurs="1"/>
							<xsd:element ref="OME:FilterSetRef" minOccurs="0" maxOccurs="1"/>
						</xsd:sequence>
						<xsd:attribute name="Origin" use="optional" type="ProfileSource">
							<xsd:annotation>
								<xsd:documentation>
									The case of this attribute has been fixed, it was "origin".
								</xsd:documentation>
							</xsd:annotation>
						</xsd:attribute>
					</xsd:complexType>
				</xsd:element>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	
	<xsd:simpleType name="ProfileSource"> <!-- top level definition -->
		<xsd:annotation>
			<xsd:documentation>
				Where the profile data came from.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="User"/>
			<xsd:enumeration value="File"/>
		</xsd:restriction>
	</xsd:simpleType>	
	
</xsd:schema>

