<?xml version="1.0" encoding="windows-1251"?>
<!-- edited with XMLSpy v2017 rel. 3 sp1 (x64) (http://www.altova.com) by Altova XMLSpy 2017 Professional XML Editor - Release 3, Concurrent for 20 users (AO GNIVC) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sch="http://purl.oclc.org/dsdl/schematron" xmlns:usch="http://www.unisoftware.ru/schematron-extensions" xmlns:sql="urn:schemas-microsoft-com:mapping-schema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:element name="Файл">
		<xs:annotation>
			<!---****************************************************************************************************************************************************************************-->
			<xs:appinfo>
				<sch:pattern name="Проверка имени файла на соответствие значению атрибута @ИдФайл">
					<sch:rule context="Файл">
						<sch:assert test="usch:getFileName() = @ИдФайл">
							<usch:error code="0400400007" path="@ИдФайл" value-of-select="@ИдФайл" doc-id-path="usch:getFileName()" doc-id-caption="Файл">Имя файла обмена "<usch:value-of select="usch:getFileName()"/>" не совпадает со значением элемента ИдФайл "<usch:value-of select="@ИдФайл"/>"</usch:error>
						</sch:assert>
					</sch:rule>
				</sch:pattern>
			</xs:appinfo>
			<!---****************************************************************************************************************************************************************************-->
			<xs:documentation>Файл обмена</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="РешХод">
					<xs:annotation>
						<xs:documentation>Решение по результатам рассмотрения ходатайства</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:sequence>
							<xs:element name="СвРешХод">
								<xs:annotation>
									<xs:documentation>Сведения о решении по результатам рассмотрения ходатайства</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:choice>
										<xs:element name="ИдОсн">
											<xs:annotation>
												<xs:documentation>Идентификатор файла-основания – ходатайства</xs:documentation>
											</xs:annotation>
											<xs:simpleType>
												<xs:restriction base="xs:string">
													<xs:minLength value="1"/>
													<xs:maxLength value="255"/>
												</xs:restriction>
											</xs:simpleType>
										</xs:element>
										<xs:element name="РеквХодБум">
											<xs:annotation>
												<xs:documentation>Реквизиты ходатайства, направленного на бумажном носителе</xs:documentation>
											</xs:annotation>
											<xs:complexType>
												<xs:attribute name="ДатаХод" use="required">
													<xs:annotation>
														<xs:documentation>Дата ходатайства</xs:documentation>
													</xs:annotation>
													<xs:simpleType>
														<xs:restriction base="ДатаТип"/>
													</xs:simpleType>
												</xs:attribute>
												<xs:attribute name="КодНОХод" type="СОНОТип" use="required">
													<xs:annotation>
														<xs:documentation>Код налогового органа, в который направлено ходатайство</xs:documentation>
													</xs:annotation>
												</xs:attribute>
											</xs:complexType>
										</xs:element>
									</xs:choice>
									<xs:attribute name="НомРешХод" use="optional">
										<xs:annotation>
											<xs:documentation>Номер решения по результатам рассмотрения ходатайства</xs:documentation>
										</xs:annotation>
										<xs:simpleType>
											<xs:restriction base="xs:string">
												<xs:minLength value="1"/>
												<xs:maxLength value="20"/>
											</xs:restriction>
										</xs:simpleType>
									</xs:attribute>
									<xs:attribute name="ДатаРешХод" use="required">
										<xs:annotation>
											<xs:documentation>Дата решения по результатам рассмотрения ходатайства</xs:documentation>
										</xs:annotation>
										<xs:simpleType>
											<xs:restriction base="ДатаТип"/>
										</xs:simpleType>
									</xs:attribute>
								</xs:complexType>
							</xs:element>
							<xs:element name="РезРассмХод" maxOccurs="unbounded">
								<xs:annotation>
									<xs:documentation>Результат рассмотрения ходатайства</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:sequence>
										<xs:element name="ИмяФайл" maxOccurs="unbounded">
											<xs:annotation>
												<xs:documentation>Имя файла</xs:documentation>
											</xs:annotation>
											<xs:simpleType>
												<xs:restriction base="xs:string">
													<xs:minLength value="1"/>
													<xs:maxLength value="255"/>
												</xs:restriction>
											</xs:simpleType>
										</xs:element>
									</xs:sequence>
									<xs:attribute name="РешХод" use="required">
										<xs:annotation>
											<xs:documentation>Решение по результатам рассмотрения ходатайства</xs:documentation>
										</xs:annotation>
										<xs:simpleType>
											<xs:restriction base="xs:string">
												<xs:length value="2"/>
												<xs:enumeration value="01"/>
												<xs:enumeration value="02"/>
												<xs:enumeration value="03"/>
												<xs:enumeration value="04"/>
											</xs:restriction>
										</xs:simpleType>
									</xs:attribute>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
						<xs:attribute name="КНД" use="required">
							<xs:annotation>
								<xs:documentation>Код формы документа по классификатору налоговых документов (КНД)</xs:documentation>
							</xs:annotation>
							<xs:simpleType>
								<xs:restriction base="КНДТип">
									<xs:enumeration value="1122045"/>
								</xs:restriction>
							</xs:simpleType>
						</xs:attribute>
						<xs:attribute name="ДатаДок" type="ДатаТип" use="required">
							<xs:annotation>
								<xs:documentation>Дата формирования документа</xs:documentation>
							</xs:annotation>
						</xs:attribute>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
			<xs:attribute name="ИдФайл" use="required">
				<xs:annotation>
					<xs:documentation>Идентификатор файла</xs:documentation>
					<xs:documentation>Повторяет имя передаваемого файла (без расширения)</xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:minLength value="1"/>
						<xs:maxLength value="255"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="ВерсФорм" use="required">
				<xs:annotation>
					<xs:documentation>Версия формата</xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:minLength value="1"/>
						<xs:maxLength value="5"/>
						<xs:enumeration value="5.01"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="ВерсПрог" use="required">
				<xs:annotation>
					<xs:documentation>Версия программы, с помощью которой сформирован файл</xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:maxLength value="40"/>
						<xs:minLength value="1"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	<xs:simpleType name="ИННФЛТип">
		<xs:annotation>
			<xs:documentation>Идентификационный номер налогоплательщика - физического лица</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:length value="12"/>
			<xs:pattern value="([0-9]{1}[1-9]{1}|[1-9]{1}[0-9]{1})[0-9]{10}"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="ИННЮЛТип">
		<xs:annotation>
			<xs:documentation>Идентификационный номер налогоплательщика - организации</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:length value="10"/>
			<xs:pattern value="([0-9]{1}[1-9]{1}|[1-9]{1}[0-9]{1})[0-9]{8}"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="КППТип">
		<xs:annotation>
			<xs:documentation>Код причины постановки на учет (КПП) - 5 и 6 знаки от 0-9 и A-Z</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:length value="9"/>
			<xs:pattern value="([0-9]{1}[1-9]{1}|[1-9]{1}[0-9]{1})([0-9]{2})([0-9A-Z]{2})([0-9]{3})"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="КНДТип">
		<xs:annotation>
			<xs:documentation>Код из Классификатора налоговой документации</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:length value="7"/>
			<xs:pattern value="[0-9]{7}"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="СОНОТип">
		<xs:annotation>
			<xs:documentation>Коды из Классификатора системы обозначений налоговых органов</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:length value="4"/>
			<xs:pattern value="[0-9]{4}"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="ДатаТип">
		<xs:annotation>
			<xs:documentation>Дата в формате ДД.ММ.ГГГГ (01.01.1900 - 31.12.2099)</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:length value="10"/>
			<xs:pattern value="(((0[1-9]{1}|[1-2]{1}[0-9]{1})\.(0[1-9]{1}|1[0-2]{1}))|((30)\.(01|0[3-9]{1}|1[0-2]{1}))|((31)\.(01|03|05|07|08|10|12)))\.(19[0-9]{2}|20[0-9]{2})"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>
