<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2008 (http://www.altova.com) by sas-softwares@procergs.rs.gov.br (PROCERGS) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.portalfiscal.inf.br/nfe" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" targetNamespace="http://www.portalfiscal.inf.br/nfe" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:include schemaLocation="tiposBasico_v1.03.xsd"/>
	<xs:element name="detEvento">
		<xs:annotation>
			<xs:documentation>Schema XML de validação do evento de Comprovante de Entrega da NF-e</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="descEvento">
					<xs:simpleType>
						<xs:restriction base="xs:string">
							<xs:enumeration value="Insucesso na Entrega da NF-e"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:element>
				<xs:element name="cOrgaoAutor" type="TCOrgaoIBGE"/>
				<xs:element name="verAplic" type="TVerAplic">
					<xs:annotation>
						<xs:documentation>Versão do Aplicativo do Autor do Evento</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="dhTentativaEntrega" type="TDateTimeUTC">
					<xs:annotation>
						<xs:documentation>Data e hora do final da tentativa entrega. Formato AAAA-MMDDThh:mm:ssTZD
				</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="nTentativa" minOccurs="0">
					<xs:simpleType>
						<xs:annotation>
							<xs:documentation>Número da tentativa de entrega que não teve sucesso</xs:documentation>
						</xs:annotation>
						<xs:restriction base="xs:string">
							<xs:pattern value="[0-9]{1,3}"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:element>
				<xs:element name="tpMotivo">
					<xs:simpleType>
						<xs:annotation>
							<xs:documentation>Motivo do insucesso - 1 – Recebedor não encontrado 
													2 – Recusa do recebedor 
													3 – Endereço inexistente 
													4 – Outros (exige informar justificativa) </xs:documentation>
						</xs:annotation>
						<xs:restriction base="xs:string">
							<xs:whiteSpace value="preserve"/>
							<xs:enumeration value="1"/>
							<xs:enumeration value="2"/>
							<xs:enumeration value="3"/>
							<xs:enumeration value="4"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:element>
				<xs:element name="xJustMotivo" minOccurs="0">
					<xs:annotation>
						<xs:documentation>Justificativa do motivo do insucesso. Informar apenas para tpMotivo=4 </xs:documentation>
					</xs:annotation>
					<xs:simpleType>
						<xs:restriction base="TString">
							<xs:maxLength value="250"/>
							<xs:minLength value="25"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:element>
				<xs:element name="latGPS" type="TLatitude" minOccurs="0">
					<xs:annotation>
						<xs:documentation>Latitude do ponto de entrega</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="longGPS" type="TLongitude" minOccurs="0">
					<xs:annotation>
						<xs:documentation>Longitude do ponto de entrega</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="hashTentativaEntrega">
					<xs:annotation>
						<xs:documentation>Hash (SHA1) no formato Base64 resultante da concatenação: Chave de acesso da NFe + Base64 da imagem capturada da entrega (Exemplo: imagem capturada da assinatura eletrônica, digital do recebedor, foto, etc)
Observação: 28 caracteres são representados no schema como 20 bytes do tipo base64Binary</xs:documentation>
					</xs:annotation>
					<xs:simpleType>
						<xs:restriction base="xs:base64Binary">
							<xs:length value="20"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:element>
				<xs:element name="dhHashTentativaEntrega" type="TDateTimeUTC" minOccurs="0">
					<xs:annotation>
						<xs:documentation>Data e hora da geração do hash da tentativa de entrega. Formato AAAA-MMDDThh:mm:ssTZD. 
				</xs:documentation>
					</xs:annotation>
				</xs:element>
			</xs:sequence>
			<xs:attribute name="versao" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:whiteSpace value="preserve"/>
						<xs:enumeration value="1.00"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
</xs:schema>
