<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="urn:epcglobal:tdt:xsd:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tdt="urn:epcglobal:tdt:xsd:1" elementFormDefault="unqualified" attributeFormDefault="unqualified" version="1.0">
	<xsd:annotation>
		<xsd:documentation><![CDATA[
			<epcglobal:copyright>Copyright ©2004 Epcglobal Inc., All Rights Reserved.</epcglobal:copyright>
			<epcglobal:disclaimer>EPCglobal Inc., its members, officers, directors, employees, or agents shall not be liable for any injury, loss, damages, financial or otherwise, arising from, related to, or caused by the use of this document.  The use of said document shall constitute your express consent to the foregoing exculpation.</epcglobal:disclaimer>
			<epcglobal:specification>Tag Data Translation (TDT) version 1.0</epcglobal:specification>
    ]]></xsd:documentation>
	</xsd:annotation>

	<xsd:include schemaLocation="./LevelTypeList.xsd"/>
	<xsd:include schemaLocation="./TagLengthList.xsd"/>
	<xsd:include schemaLocation="./SchemeNameList.xsd"/>
	<xsd:include schemaLocation="./InputFormatList.xsd"/>
	<xsd:include schemaLocation="./ModeList.xsd"/>
	<xsd:include schemaLocation="./CompactionMethodList.xsd"/>
	<xsd:include schemaLocation="./PadDirectionList.xsd"/>

	<xsd:complexType name="Field">
		<xsd:attribute name="seq" type="xsd:integer" use="required"/>
		<xsd:attribute name="name" type="xsd:string" use="required"/>
		<xsd:attribute name="bitLength" type="xsd:integer"/>
		<xsd:attribute name="characterSet" type="xsd:string" use="required"/>
		<xsd:attribute name="compaction" type="tdt:CompactionMethodList"/>
		<xsd:attribute name="compression" type="xsd:string"/>
		<xsd:attribute name="padChar" type="xsd:string"/>
		<xsd:attribute name="padDir" type="tdt:PadDirectionList"/>
		<xsd:attribute name="decimalMinimum" type="xsd:string"/>
		<xsd:attribute name="decimalMaximum" type="xsd:string"/>
		<xsd:attribute name="length" type="xsd:integer"/>
	</xsd:complexType>

	<xsd:complexType name="Option">
		<xsd:sequence>
			<xsd:element name="field" type="tdt:Field" maxOccurs="unbounded"/>
		</xsd:sequence>
		<xsd:attribute name="optionKey" type="xsd:string" use="required"/>
		<xsd:attribute name="pattern" type="xsd:string"/>
		<xsd:attribute name="grammar" type="xsd:string" use="required"/>
	</xsd:complexType>

	<xsd:complexType name="Rule">
		<xsd:attribute name="type" type="tdt:ModeList" use="required"/>
		<xsd:attribute name="inputFormat" type="tdt:InputFormatList" use="required"/>
		<xsd:attribute name="seq" type="xsd:integer" use="required"/>
		<xsd:attribute name="newFieldName" type="xsd:string" use="required"/>
		<xsd:attribute name="characterSet" type="xsd:string" use="required"/>
		<xsd:attribute name="padChar" type="xsd:string"/>
		<xsd:attribute name="padDir" type="tdt:PadDirectionList"/>
		<xsd:attribute name="decimalMinimum" type="xsd:string"/>
		<xsd:attribute name="decimalMaximum" type="xsd:string"/>
		<xsd:attribute name="length" type="xsd:string"/>
		<xsd:attribute name="function" type="xsd:string" use="required"/>
		<xsd:attribute name="tableURL" type="xsd:string"/>
		<xsd:attribute name="tableParams" type="xsd:string"/>
		<xsd:attribute name="tableXPath" type="xsd:string"/>
		<xsd:attribute name="tableSQL" type="xsd:string"/>
	</xsd:complexType>
				
	<xsd:complexType name="Level">
		<xsd:sequence>
			<xsd:element name="option" type="tdt:Option" minOccurs="1" maxOccurs="unbounded"/>
			<xsd:element name="rule" type="tdt:Rule" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
		<xsd:attribute name="type" type="tdt:LevelTypeList" use="required"/>
		<xsd:attribute name="prefixMatch" type="xsd:string"/>
		<xsd:attribute name="requiredParsingParameters" type="xsd:string"/>
		<xsd:attribute name="requiredFormattingParameters" type="xsd:string"/>
	</xsd:complexType>
				
	<xsd:complexType name="Scheme">
		<xsd:sequence>
			<xsd:element name="level" type="tdt:Level" minOccurs="4" maxOccurs="5"/>
		</xsd:sequence>
		<xsd:attribute name="name" type="tdt:SchemeNameList" use="required"/>
		<xsd:attribute name="optionKey" type="xsd:string" use="required"/>
		<xsd:attribute name="tagLength" type="tdt:TagLengthList" use="required"/>
	</xsd:complexType>

	<xsd:complexType name="EpcTagDataTranslation">
		<xsd:sequence>
			<xsd:element name="scheme" type="tdt:Scheme" maxOccurs="unbounded"/>
		</xsd:sequence>
		<xsd:attribute name="version" type="xsd:string" use="required"/>
		<xsd:attribute name="date" type="xsd:dateTime" use="required"/>
		<xsd:attribute name="epcTDSVersion" type="xsd:string" use="required"/>
	</xsd:complexType>
	
	<xsd:element name="epcTagDataTranslation" type="tdt:EpcTagDataTranslation"/>
</xsd:schema>
