<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.io-link.com/IODD/2009/11" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:iodd="http://www.io-link.com/IODD/2009/11" targetNamespace="http://www.io-link.com/IODD/2009/11" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0.1">
	<xsd:include schemaLocation="IODD-Primitives1.0.1.xsd"/>
	<xsd:include schemaLocation="IODD-Datatypes1.0.1.xsd"/>
	<xsd:include schemaLocation="IODD-Variables1.0.1.xsd"/>
	<xsd:include schemaLocation="IODD-UserInterface1.0.1.xsd"/>
	<xsd:include schemaLocation="IODD-Events1.0.1.xsd"/>
	<xsd:element name="IODDStandardDefinitions" type="IODDStandardDefinitionsT">
		<!-- unique, key -->
		<xsd:unique name="Variable_Index">
			<xsd:selector xpath=".//iodd:Variable"/>
			<xsd:field xpath="@index"/>
		</xsd:unique>
		<xsd:key name="Variable_Id">
			<xsd:selector xpath=".//iodd:Variable"/>
			<xsd:field xpath="@id"/>
		</xsd:key>
		<xsd:key name="PrimaryLanguage_Id">
			<xsd:selector xpath=".//iodd:PrimaryLanguage/iodd:Text"/>
			<xsd:field xpath="@id"/>
		</xsd:key>
		<!-- keyref -->
		<xsd:keyref name="_TextId" refer="PrimaryLanguage_Id">
			<xsd:selector xpath=".//*"/>
			<xsd:field xpath="@textId"/>
		</xsd:keyref>
	</xsd:element>
	<xsd:complexType name="IODDStandardDefinitionsT">
		<xsd:sequence>
			<xsd:element name="DocumentInfo" type="DocumentInfoT"/>
			<xsd:element name="VariableCollection" type="IODDStandardVariableCollectionT"/>
			<xsd:element name="ExternalTextCollection" type="ExternalTextCollectionT">
				<xsd:unique name="Language">
					<xsd:selector xpath="iodd:PrimaryLanguage|iodd:Language"/>
					<xsd:field xpath="@xml:lang"/>
				</xsd:unique>
			</xsd:element>
			<xsd:element name="Stamp" type="StampT">
				<xsd:annotation>
					<xsd:documentation>Filled out by the IODD Checker.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="IODDStandardVariableCollectionT">
		<xsd:complexContent>
			<xsd:extension base="CollectionT">
				<xsd:sequence>
					<xsd:element name="Variable" type="IODDStandardVariableT" maxOccurs="unbounded">
						<xsd:unique name="Variable_RecordItemInfo_Subindex">
							<xsd:selector xpath="iodd:RecordItemInfo"/>
							<xsd:field xpath="@subindex"/>
						</xsd:unique>
					</xsd:element>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>
	<xsd:complexType name="IODDStandardEventCollectionT">
		<xsd:complexContent>
			<xsd:extension base="CollectionT">
				<xsd:sequence>
					<xsd:element name="Event" type="EventT" maxOccurs="unbounded"/>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>
	<xsd:element name="IODDStandardUnitDefinitions" type="IODDStandardUnitDefinitionsT">
		<xsd:key name="UnitPrimaryLanguage_Id">
			<xsd:selector xpath=".//iodd:PrimaryLanguage/iodd:Text"/>
			<xsd:field xpath="@id"/>
		</xsd:key>
		<!-- keyref -->
		<xsd:keyref name="Unit_TextId" refer="UnitPrimaryLanguage_Id">
			<xsd:selector xpath=".//*"/>
			<xsd:field xpath="@textId"/>
		</xsd:keyref>
	</xsd:element>
	<xsd:complexType name="IODDStandardUnitDefinitionsT">
		<xsd:sequence>
			<xsd:element name="DocumentInfo" type="DocumentInfoT"/>
			<xsd:element name="UnitCollection" type="UnitCollectionT"/>
			<xsd:element name="ExternalTextCollection" type="ExternalTextCollectionT">
				<!-- this constraint does not work with .NET V1.x :-(
				<xsd:unique name="Language">
					<xsd:selector xpath="iodd:PrimaryLanguage|iodd:Language"/>
					<xsd:field xpath="@xml:lang"/>
				</xsd:unique> -->
			</xsd:element>
			<xsd:element name="Stamp" type="StampT">
				<xsd:annotation>
					<xsd:documentation>Filled out by the IODD Checker.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="IODDStandardVariableT">
		<xsd:complexContent>
			<xsd:extension base="VariableT">
				<xsd:attribute name="mandatory" type="xsd:boolean" default="false"/>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>
	<xsd:complexType name="UnitCollectionT">
		<xsd:complexContent>
			<xsd:extension base="CollectionT">
				<xsd:sequence>
					<xsd:element name="Unit" maxOccurs="unbounded">
						<xsd:complexType>
							<xsd:attribute name="code" type="xsd:positiveInteger" use="required"/>
							<xsd:attribute name="abbr" type="xsd:token" use="required"/>
							<xsd:attribute name="textId" type="RefT" use="required"/>
						</xsd:complexType>
					</xsd:element>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>
</xsd:schema>
