<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://www.portalfiscal.inf.br/mdfe" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" targetNamespace="http://www.portalfiscal.inf.br/mdfe" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:include schemaLocation="tiposGeralMDFe_v1.00.xsd"/>
	<xs:element name="ferrov">
		<xs:annotation>
			<xs:documentation>Informações do modal Ferroviário</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="trem">
					<xs:annotation>
						<xs:documentation>Informações da composição do trem</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:sequence>
							<xs:element name="xPref">
								<xs:annotation>
									<xs:documentation>Prefixo do Trem</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="TString">
										<xs:minLength value="1"/>
										<xs:maxLength value="10"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="dhTrem" minOccurs="0">
								<xs:annotation>
									<xs:documentation>Data e hora de liberação do trem na origem</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="xs:string">
										<xs:pattern value="(((20(([02468][048])|([13579][26]))-02-29))|(20[0-9][0-9])-((((0[1-9])|(1[0-2]))-((0[1-9])|(1\d)|(2[0-8])))|((((0[13578])|(1[02]))-31)|(((0[1,3-9])|(1[0-2]))-(29|30)))))T(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="xOri">
								<xs:annotation>
									<xs:documentation>Origem do Trem</xs:documentation>
									<xs:documentation>Sigla da estação de origem</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="TString">
										<xs:minLength value="1"/>
										<xs:maxLength value="3"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="xDest">
								<xs:annotation>
									<xs:documentation>Destino do Trem</xs:documentation>
									<xs:documentation>Sigla da estação de destino</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="TString">
										<xs:minLength value="1"/>
										<xs:maxLength value="3"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="qVag">
								<xs:annotation>
									<xs:documentation>Quantidade de vagões carregados</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="xs:string">
										<xs:pattern value="[1-9]{1}[0-9]{0,2}"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="vag" maxOccurs="unbounded">
					<xs:annotation>
						<xs:documentation>informações dos Vagões</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:sequence>
							<xs:element name="serie">
								<xs:annotation>
									<xs:documentation>Serie de Identificação do vagão</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="TString">
										<xs:length value="3"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="nVag">
								<xs:annotation>
									<xs:documentation>Número de Identificação do vagão</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="xs:string">
										<xs:whiteSpace value="preserve"/>
										<xs:minLength value="1"/>
										<xs:maxLength value="8"/>
										<xs:pattern value="[1-9]{1}[0-9]{0,7}"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="nSeq" minOccurs="0">
								<xs:annotation>
									<xs:documentation>Sequencia do vagão na composição</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="xs:string">
										<xs:whiteSpace value="preserve"/>
										<xs:pattern value="[1-9]{1}[0-9]{0,2}"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="TU" type="TDec_0303">
								<xs:annotation>
									<xs:documentation>Tonelada Útil</xs:documentation>
									<xs:documentation>Unidade de peso referente à carga útil (apenas o peso da carga transportada), expressa em toneladas.</xs:documentation>
								</xs:annotation>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>
