<?xml version="1.0" encoding="UTF-8"?>
<!--  Delft FEWS Published Interface (Copyright 2003 WL | Delft Hydraulics) -->
<schema targetNamespace="http://www.wldelft.nl/fews/PI" xmlns:fews="http://www.wldelft.nl/fews/PI" xmlns="http://www.w3.org/2001/XMLSchema"  elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
	<include schemaLocation="pi_sharedtypes.xsd"/>
	<element name="Table" type="fews:TableComplexType">
		<annotation>
			<documentation>To relate 2 or three parameters (e.g. stage height to discharge) lookup tables are used.

                This can be used also to describe level-area curves for off-line storage areas</documentation>
		</annotation>
	</element>
	<complexType name="TableComplexType">
		<annotation>
			<documentation>To relate 2 or three parameters (e.g. stage height to discharge) lookup tables are used.
             This can be used also to describe level-area curves for off-line storage areas</documentation>
		</annotation>
		<sequence>
			<group ref="fews:TimeZoneChoice" minOccurs="0"/>
			<element name="rel" type="fews:RelationComplexType" maxOccurs="unbounded"/>
			<element name="comment" type="fews:commentString" minOccurs="0">
				<annotation>
					<documentation>use this field as a notebook to add comments, suggestions
                        description of data entered etc.</documentation>
				</annotation>
			</element>
		</sequence>
		<attribute name="version" type="fews:versionString" default="1.2"/>
	</complexType>
	<complexType name="RelationComplexType">
		<sequence>
			<element name="info" type="fews:InfoComplexType"/>
			<element name="rows" type="int">
				<annotation>
					<documentation>Number of rows</documentation>
				</annotation>
			</element>
			<element name="cols" type="int">
				<annotation>
					<documentation>Number of  columns</documentation>
				</annotation>
			</element>
			<element name="rowdata" type="fews:DataComplexType" maxOccurs="unbounded"/>
		</sequence>
	</complexType>
	<complexType name="InfoComplexType">
		<sequence>
			<element name="startDate" type="fews:DateTimeComplexType">
				<annotation>
					<documentation>start date and time from which the relation is valid.</documentation>
				</annotation>
			</element>
			<element name="endDate" type="fews:DateTimeComplexType" minOccurs="0">
				<annotation>
					<documentation>end date and time until which the relation is valid.
                        If not present the relation is assumed to be valid indefinitely</documentation>
				</annotation>
			</element>
			<element name="extrapolation">
				<annotation>
					<documentation>type of extrapolation if outside the range:
                        non = not allowed, critical stop
                        maxmin = stays fixed at max (or) min level in table
                        linear = linear extrapolation</documentation>
				</annotation>
				<complexType>
					<attribute name="type" use="required">
						<annotation>
							<documentation/>
						</annotation>
						<simpleType>
							<restriction base="string">
								<enumeration value="non"/>
								<enumeration value="maxmin"/>
								<enumeration value="linear"/>
							</restriction>
						</simpleType>
					</attribute>
				</complexType>
			</element>
		</sequence>
	</complexType>
	<complexType name="DataComplexType">
		<sequence>
			<element name="columndata" maxOccurs="unbounded">
				<annotation>
					<documentation>The type attribute determines how the data is interpreted: double, long or string.
                    The total number of items MUST match rows*cols. Items are processes from top left to bottom right, row by row</documentation>
				</annotation>
				<complexType>
					<attribute name="columnnumber" type="int" use="optional"/>
					<attribute name="type" use="required">
						<simpleType>
							<restriction base="string">
								<enumeration value="double"/>
								<enumeration value="int"/>
								<enumeration value="string"/>
							</restriction>
						</simpleType>
					</attribute>
					<attribute name="value" type="string" use="required"/>
				</complexType>
			</element>
		</sequence>
		<attribute name="rownumber" type="int" use="optional"/>
	</complexType>
</schema>
