<?xml version="1.0" encoding="UTF-8"?>
<xs:schema version="1.1"
	targetNamespace="http://www.biocase.org/schemas/qtprefs/1.1" 
	xmlns="http://www.biocase.org/schemas/qtprefs/1.1" 
	xmlns:xs="http://www.w3.org/2001/XMLSchema" 
	elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:element name="Skin">
		<xs:annotation>
			<xs:documentation>querytool preferences for a 'skin' covering multiple datasources</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Schema" maxOccurs="unbounded">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="Concepts">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="Concept" maxOccurs="unbounded">
											<xs:complexType>
												<xs:attribute name="path" type="xs:string" use="required"/>
												<xs:attribute name="label" type="xs:string" use="required"/>
												<xs:attribute name="cops" type="cops" use="optional" default="~"/>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="Grouping">
								<xs:annotation>
									<xs:documentation>The default grouping of a search</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:attribute name="concept" type="xs:string" use="required"/>
								</xs:complexType>
							</xs:element>
							<xs:element name="Recordlist">
								<xs:annotation>
									<xs:documentation>Preferences for the display of a list of records.</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:sequence>
										<xs:element name="NoRecordMessage" type="xs:string"/>
									</xs:sequence>
									<xs:attribute name="stylesheet" type="xs:string" use="required"/>
									<xs:attribute name="limit" type="xs:integer" use="optional" default="100"/>
								</xs:complexType>
							</xs:element>
							<xs:element name="Details">
								<xs:annotation>
									<xs:documentation>Preferences for different detail result pages showing a single record</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:sequence>
										<xs:element name="Detail" maxOccurs="unbounded">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="RecordID" maxOccurs="unbounded">
														<xs:complexType>
															<xs:attribute name="parametername" type="xs:string" use="required"/>
															<xs:attribute name="path" type="xs:string" use="required"/>
														</xs:complexType>
													</xs:element>
													<xs:element name="NotAvailableMessage" type="xs:string" minOccurs="0" maxOccurs="1" />
												</xs:sequence>
												<xs:attribute name="name" type="xs:string" use="required"/>
												<xs:attribute name="stylesheet" type="xs:string" use="required"/>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
						<xs:attribute name="ns" type="xs:anyURI" use="required"/>
						<xs:attribute name="label" type="xs:string" use="required"/>
					</xs:complexType>
					<xs:key name="conceptID">
						<xs:selector xpath=".//Concept"/>
						<xs:field xpath="@path"/>
					</xs:key>
					<xs:key name="DetailID">
						<xs:selector xpath=".//Detail"/>
						<xs:field xpath="@name"/>
					</xs:key>
					<xs:keyref name="GroupingConceptFK" refer="conceptID">
						<xs:selector xpath="Grouping"/>
						<xs:field xpath="@concept"/>
					</xs:keyref>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="Querytool">
		<xs:annotation>
			<xs:documentation>querytool preferences for a 'skin' covering multiple datasources</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Skin" type="xs:string" default="default"/>
				<xs:element name="Schema" maxOccurs="unbounded">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="Concepts">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="Concept" maxOccurs="unbounded">
											<xs:complexType>
												<xs:attribute name="path" type="xs:string" use="required"/>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
						<xs:attribute name="ns" type="xs:anyURI" use="required"/>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:simpleType name="cops">
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="4"/>
			<xs:whiteSpace value="collapse"/>
			<xs:pattern value="&lt;?=?&gt;?|b|~"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>
