<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema targetNamespace="http://reflectk.de/CQL/instbook.xsd" xmlns="http://reflectk.de/CQL/instbook.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

	<xsd:element name="instbook">
		<xsd:complexType>
			<xsd:all>
			
				<xsd:element name="head" minOccurs="0" maxOccurs="1" type="xsd:string" />

				<xsd:element name="instructions" minOccurs="1" maxOccurs="1">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:element name="instruction" minOccurs="1" maxOccurs="unbounded">
								<xsd:complexType>
									<xsd:all>
										<xsd:element name="hint" minOccurs="0" maxOccurs="1" type="xsd:string" />
										<xsd:element name="condition" minOccurs="0" maxOccurs="1">
											<xsd:complexType>
												<xsd:all>
													<xsd:element name="mode" type="xsd:string" minOccurs="1" maxOccurs="1" />
													<xsd:element name="threshold" type="xsd:integer" minOccurs="1" maxOccurs="1" />
													<xsd:element name="whitelist" type="xsd:string" minOccurs="0" maxOccurs="1" />
												</xsd:all>
											</xsd:complexType>
										</xsd:element>
									</xsd:all>
									<xsd:attribute name="id" type="xsd:ID" use="required"/>
									<xsd:attribute name="rule" type="xsd:string" use="required"/>
									<xsd:attribute name="priority" use="required">
										<xsd:simpleType>
											<xsd:restriction base="xsd:string">
												<xsd:enumeration value="INFORMATION"/>
												<xsd:enumeration value="WARNING"/>
												<xsd:enumeration value="ERROR"/>
											</xsd:restriction>
										</xsd:simpleType>
									</xsd:attribute>
								</xsd:complexType>
							</xsd:element>
						</xsd:sequence>
					</xsd:complexType>
				</xsd:element>
				
				<xsd:element name="locations" minOccurs="1" maxOccurs="1">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:element name="location" minOccurs="1" maxOccurs="unbounded">
								<xsd:complexType>
								    <xsd:simpleContent>
      									<xsd:extension base="xsd:string">
											<xsd:attribute name="prefix" use="required">
												<xsd:simpleType>
													<xsd:restriction base="xsd:string">
														<xsd:pattern value="[^:]+"/>
													</xsd:restriction>
												</xsd:simpleType>
											</xsd:attribute>
      									</xsd:extension>
    								</xsd:simpleContent>
								</xsd:complexType>
							</xsd:element>
						</xsd:sequence>
					</xsd:complexType>
				</xsd:element>
				
				<xsd:element name="tail" minOccurs="0" maxOccurs="1" type="xsd:string"/>

			</xsd:all>
			
		</xsd:complexType>
	</xsd:element>



</xsd:schema>

