<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright © 2007 Kuratorium für Technik und Bauwesen in der Landwirtschaft e.V. (KTBL). All Rights Reserved. http://www.agroxml.de/Legal/

This KTBL work (including software, documents, or other related items) is being provided by the copyright holders under the following license.
By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions: Permission to use, copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications, that you make:

1.	The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
2.	Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist,
	a short notice of the following form (hypertext is preferred, text is permitted) should be used within
	the body of any redistributed or derivative code:
	"Copyright © [$date-of-software] Kuratorium für Technik und Bauwesen in der Landwirtschaft e.V. (KTBL).
	All Rights Reserved. http://www.agroxml.de/Legal/"
3.	Notice of any changes or modifications to the KTBL files, including the date changes were made.
	(We recommend you provide URIs to the location from which the code is derived.)

THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.

The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
-->
<!-- Profil zur Fütterung des Simcerc-Modells (Getreide) bei ISIP mit Daten. offen: Einschränkung auf Getreide von BasicDocumentation/Cultivation/Crop/CropSpeciesCode ist nicht möglich, da der CropType auch vom Element BasicDocumentation/Cultivation/PrecedingCrop/CropSpeciesCode verwendet wird, und da natürlich auch andere Arten möglich sind. Die Prüfung muss also auf Anwendungsebene erfolgen. -->
<!-- Profile for feeding the Simcerc and the Simonto model (Cereals) of ISIP with data. -->
<xsd:schema xmlns="http://www.agroxml.de/schema/agroxml1.3" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" targetNamespace="http://www.agroxml.de/schema/agroxml1.3" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.3">
	<xsd:import namespace="http://www.w3.org/1999/xlink" schemaLocation="../external/xlink/xlinks.xsd"/>
	<xsd:element name="AgroxmlDoc" type="AgroxmlDocType"/>
	<xsd:complexType name="AgroxmlDocType">
		<xsd:sequence>
			<xsd:element ref="Field" maxOccurs="unbounded"/>
			<xsd:element ref="Cultivation" maxOccurs="unbounded"/>
			<xsd:element ref="WorkProcess" maxOccurs="unbounded"/>
			<xsd:element ref="WeatherStation" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>
	<!-- From different modules -->
	<xsd:complexType name="FieldType">
		<xsd:annotation>
			<xsd:documentation>Vorheriger deutscher Name: SchlagType.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence minOccurs="0">
			<xsd:element name="NameOfField" type="xsd:normalizedString"/>
			<xsd:element name="NumberOfField" type="xsd:normalizedString" minOccurs="0"/>
		</xsd:sequence>
		<xsd:attribute name="id" type="xsd:ID"/>
	</xsd:complexType>
	<xsd:element name="Field" type="FieldType"/>
	<xsd:complexType name="CultivationType">
		<xsd:annotation>
			<xsd:documentation>Hier wird der Anbau, also die angebauten Früchte, angegeben.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element ref="ReferenceField">
				<xsd:annotation>
					<xsd:documentation>ReferenceField ist ein leeres Element, in dessen idref-Attribut der Bezug zum Feld gesetzt wird.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="PrimaryCrop" type="CropType" maxOccurs="unbounded">
				<xsd:annotation>
					<xsd:documentation>Die Hauptfrucht. Simcerc ist ein Modell für Getreide, an dieser Stelle dürfen in den Unterelementen also nur Getreidearten auftauchen.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="CatchCrop" type="CropType" minOccurs="0" maxOccurs="unbounded">
				<xsd:annotation>
					<xsd:documentation>Die Zwischenfrucht. Wird möglicherweise nicht benötigt.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element ref="PrecedingCrop" minOccurs="2" maxOccurs="3">
				<xsd:annotation>
					<xsd:documentation>Damit das Simcerc-Modell bedient werden kann, muss mit Hilfe dieses Elements die Vorfrucht sowie die Vorvorfrucht angegeben werden. Daher ist minOccurs hier auf 2 gesetzt.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:element name="Cultivation" type="CultivationType"/>
	<xsd:complexType name="WorkProcessType">
		<xsd:annotation>
			<xsd:documentation>Vorheriger deutscher Name: ArbeitsgangType.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="StartDateTime" type="xsd:dateTime"/>
			<xsd:element name="Seeding" type="SeedingType"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:element name="WorkProcess" type="WorkProcessType">
		<xsd:annotation>
			<xsd:documentation xml:lang="de">Vorheriger deutscher Name: Arbeitsgang. Ein Arbeitsgang ist eine in sich zeitlich und gegebenenfalls auch räumlich abgeschlossene, auf einer oder mehreren Flächen oder auf dem Betrieb (Hoffläche, Gebäude) durchgeführte Maßnahme mit dem Zweck, die landwirtschaftliche Produktion zu unterstützen. Innerhalb eines Arbeitsganges können mehrere Applikationen gleichzeitig erfolgen. Das heisst, wenn z. B. Duengung und Saat - wie im Maisanbau mit Unterfußdüngung üblich - in einer Überfahrt erledigt werden, so ist dies '''ein''' Arbeitsgang. Erfolgen die Maßnahmen hintereinander, so handelt es sich um getrennte Arbeitsgänge. Deshalb kommen die Elemente StartDateTime und EndDateTime jeweils nur einmal auf Ebene des Arbeitsganges vor.</xsd:documentation>
			<xsd:documentation xml:lang="en">Previous german name: Arbeitsgang</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:complexType name="WeatherStationType">
		<xsd:annotation>
			<xsd:documentation>Vorheriger deutscher Name: WetterstationType.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="WeatherStationCode" type="CodeType">
				<xsd:annotation>
					<xsd:documentation xml:lang="de">Stationscode der Wetterstation. Zu befüllen aus der Liste unter http://www.isip.de/...xml</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:element name="WeatherStation" type="WeatherStationType"/>
	<xsd:complexType name="PrecedingCropType">
		<xsd:annotation>
			<xsd:documentation>Vorheriger deutscher Name: VorfruchtType. Die Elemente HarvestYear müssen für ISIP mit aufeinanderfolgenden Jahren befüllt sein.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="Crop" type="CropType" maxOccurs="unbounded"/>
			<xsd:element name="HarvestYear" type="xsd:gYear">
				<xsd:annotation>
					<xsd:documentation>Das Erntejahr der Vorfrucht. Da für ISIP Vor- und Vorvorfrucht von Bedeutung sind, müssen in diesem Element die beiden vorhergehenden Jahre festgehalten sein.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:element name="PrecedingCrop" type="PrecedingCropType"/>
	<xsd:complexType name="CodeType">
		<xsd:simpleContent>
			<xsd:extension base="xsd:normalizedString">
				<xsd:attribute name="codeSpace" type="xsd:anyURI" use="required"/>
				<xsd:attribute name="codeListVersionID" type="xsd:normalizedString" use="optional"/>
				<xsd:attribute name="languageID" type="xsd:language" use="optional"/>
			</xsd:extension>
		</xsd:simpleContent>
	</xsd:complexType>
	<xsd:complexType name="CropType">
		<xsd:annotation>
			<xsd:documentation>Beschreibung der Frucht.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element name="CropSpeciesCode" type="CodeType">
				<xsd:annotation>
					<xsd:documentation>Zu befüllen aus der Inhaltsliste auf http://www.agroxml.de/content/Crop.xml</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="VarietyCode" type="CodeType">
				<xsd:annotation>
					<xsd:documentation>Zu befüllen aus der Inhaltsliste auf http://www.agroxml.de/content/Variety.xml.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="IDREFType">
		<xsd:annotation>
			<xsd:documentation xml:lang="de">Ein Typ für ein leeres Element, das lediglich zur Referenzierung anderer Elemente dient. Die ID auf, die referenziert wird, wird in das idref-Attribut geschrieben. Zur Begründung, warum die Referenz im Attribut und nicht im Elementinhalt eingetragen wird, s. http://www.w3.org/TR/xmlschema-2/#IDREF</xsd:documentation>
		</xsd:annotation>
		<xsd:attribute name="idref" type="xsd:IDREF"/>
	</xsd:complexType>
	<xsd:element name="ReferenceField" type="IDREFType">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">Vorheriger deutscher Name: RefSchlag. Element to reference from &lt;WorkProcedure&gt; to the field.</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:complexType name="SeedingType">
		<xsd:annotation>
			<xsd:documentation>Vorheriger deutscher Name: SaatType. Im Falle von ISIP wird lediglich das Datum der Aussaat benötigt. Das findet sich als Unterelement der WorkProcedure. Der Bezug zum Schlag wird aber aus ReferenceField unterhalb des Elements Seeding hergestellt. Erst dadurch wird eine Übermittlung mehrerer Schläge gleichzeitig möglich.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element ref="ReferenceField" maxOccurs="unbounded">
				<xsd:annotation>
					<xsd:documentation>Über dieses Element wird der Bezug zum Schlag hergestellt.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
</xsd:schema>
