<?xml version = "1.0" encoding = "UTF-8"?>
<!--
	#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	#
	# Copyright (C) 2003-2007 Open Microscopy Environment
	#       Massachusetts Institute of Technology,
	#       National Institutes of Health,
	#       University of Dundee,
	#       University of Wisconsin at Madison
	#
	#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<!--
	#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	# Written by:  Josiah Johnston <siah@nih.gov>, Andrew J Patterson
	#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<schema xmlns = "http://www.w3.org/2001/XMLSchema"
	targetNamespace = "http://www.openmicroscopy.org/Schemas/BinaryFile/2007-06"
	xmlns:Bin = "http://www.openmicroscopy.org/Schemas/BinaryFile/2007-06"
	xmlns:xml="http://www.w3.org/XML/1998/namespace"
	version = "2"
	 elementFormDefault = "qualified">
	<import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
	<annotation>
		<documentation>
			The elements in this file are not yet represented by classes in the EA diagrams - ajp
		</documentation>
	</annotation>
	<element name = "External">
		<annotation>
			<documentation>Describes a file location.  Can optionally specify a portion of a file using Offset and a ReadLength.
If Offset and ReadLength are specified in conjuction with Compression, then they point into the uncompressed file.
			</documentation>
		</annotation>
		<complexType>
			<attribute name = "href" use = "required" type = "anyURI">
				<annotation>
					<documentation>file location</documentation>
				</annotation>
			</attribute>
			<attribute name = "SHA1" use = "required" type = "Bin:Hex40">
				<annotation>
					<documentation>The digest of the file specified in href.</documentation>
				</annotation>
			</attribute>
			<attribute name = "Compression" default = "none">
				<annotation>
					<documentation>Specifies the compression scheme used to encode the data.</documentation>
				</annotation>
				<simpleType>
					<restriction base = "string">
						<enumeration value = "zlib"/>
						<enumeration value = "bzip2"/>
						<enumeration value = "none"/>
					</restriction>
				</simpleType>
			</attribute>
		</complexType>
	</element>
	<element name = "BinData">
		<annotation>
			<documentation>The contents of this element are base64-encoded.  These are not CDATA sections, just a base64 stream.</documentation>
		</annotation>
		<complexType>
			<simpleContent>
				<extension base = "base64Binary">
					<attribute name = "Compression" default = "none">
						<annotation>
							<documentation>Specifies the compression scheme used to encode the data. </documentation>
						</annotation>
						<simpleType>
							<restriction base = "string">
								<enumeration value = "zlib"/>
								<enumeration value = "bzip2"/>
								<enumeration value = "none"/>
							</restriction>
						</simpleType>
					</attribute>
					<attribute name="Length" use="required">
						<annotation>
							<documentation>Character count attribute for the BinData field. This is the length of the base-64 encoded block. It allows easy skipping of the block when parsing the file.
							Added in response to Evolution document - ajp</documentation>
						</annotation>
						<simpleType>
							<restriction base="nonNegativeInteger">
								
							</restriction>
						</simpleType>
					</attribute>
				</extension>
			</simpleContent>
		</complexType>
	</element>
	<element name = "BinaryFile">
		<annotation>
			<documentation>Describes a binary file.</documentation>
		</annotation>
		<complexType>
			<choice>
				<element ref = "Bin:External"/>
				<element ref = "Bin:BinData"/>
			</choice>
			<attribute name = "FileName" use = "required">
				<simpleType>
					<restriction base = "string">
						<maxLength value = "64"/>
					</restriction>
				</simpleType>
			</attribute>
			<attribute name = "Size" use = "required" type = "integer">
				<annotation>
					<documentation>Size (in bytes) of the uncompressed file.</documentation>
				</annotation>
			</attribute>
		</complexType>
	</element>
	<simpleType name = "Hex40">
		<restriction base = "hexBinary">
			<length value = "20"/>
		</restriction>
	</simpleType>
</schema>
