<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://пф.рф/МАФ/2020-08-28" xmlns:УТ2="http://пф.рф/УТ/2017-08-21" xmlns:МАФ="http://pf.rf/MAF/2020-08-28" xmlns:АФ5="http://пф.рф/АФ/2018-12-07" version="2.0" elementFormDefault="qualified" targetNamespace="http://пф.рф/МАФ/2020-08-28">

	<xs:import namespace="http://пф.рф/УТ/2017-08-21" schemaLocation="ais/%D0%A1%D1%85%D0%B5%D0%BC%D1%8B/%D0%A3%D0%BD%D0%B8%D1%84%D0%A2%D0%B8%D0%BF%D1%8B_2017-08-21.xsd"/>
	<xs:import namespace="http://пф.рф/АФ/2018-12-07" schemaLocation="ais/%D0%A1%D1%85%D0%B5%D0%BC%D1%8B/%D0%A2%D0%B8%D0%BF%D1%8B%D0%90%D0%A4_2018-12-07.xsd"/>

	<xs:annotation>
		<xs:documentation>Схема к маппингу экспликаций Альбома форматов для сайта ПФР</xs:documentation>
	</xs:annotation>
	<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:sequence>
							<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:complexType>
												<xs:sequence>
													<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:complexType>
																		<xs:sequence>
																			<xs:element name="Формат" maxOccurs="unbounded">
																				<xs:annotation>
																					<xs:documentation>Формат документа</xs:documentation>
																				</xs:annotation>
																				<xs:complexType>
																					<xs:sequence>
																						<xs:element name="Схема">
																							<xs:annotation>
																								<xs:documentation>Сведения о XSD-схеме</xs:documentation>
																							</xs:annotation>
																							<xs:complexType>
																								<xs:attribute name="Путь" type="АФ5:XSDСхема" use="required">
																									<xs:annotation>
																										<xs:documentation>Путь до XSD-схемы</xs:documentation>
																									</xs:annotation>
																								</xs:attribute>
																							</xs:complexType>
																						</xs:element>																						
																						<xs:element name="ПФ" minOccurs="0" maxOccurs="unbounded">
																							<xs:annotation>
																								<xs:documentation>Сведения о форме электронного документа в формате xls-файла</xs:documentation>
																							</xs:annotation>
																							<xs:complexType>
																								<xs:attribute name="Путь" type="АФ5:XLSФайл" use="required">
																									<xs:annotation>
																										<xs:documentation>Путь до файла с формой электронного документа в формате xls-файла</xs:documentation>
																									</xs:annotation>
																								</xs:attribute>
																							</xs:complexType>
																						</xs:element>
																						<xs:element name="Пример" minOccurs="0" maxOccurs="unbounded">
																							<xs:annotation>
																								<xs:documentation>Сведения о примере электронного документа в формате xml-файла</xs:documentation>
																							</xs:annotation>
																							<xs:complexType>
																								<xs:attribute name="Путь" type="АФ5:XMLФайл" use="required">
																									<xs:annotation>
																										<xs:documentation>Путь до примера электронного документа в формате xml-файла</xs:documentation>
																									</xs:annotation>
																								</xs:attribute>
																							</xs:complexType>
																						</xs:element>																						
																					</xs:sequence>																					
																					<xs:attribute name="Дата" type="xs:date">
																						<xs:annotation>
																							<xs:documentation>Дата формата документа. Указывается либо дата формата, либо версия формата</xs:documentation>
																						</xs:annotation>
																					</xs:attribute>
																					<xs:attribute name="Версия" type="УТ2:ТипНепустаяСтрока">
																						<xs:annotation>
																							<xs:documentation>Версия документа. Указывается либо дата формата, либо версия формата</xs:documentation>
																						</xs:annotation>
																					</xs:attribute>
																					<xs:attribute name="Статус" use="required">
																						<xs:annotation>
																							<xs:documentation>Статус формата:
																								Проект - формат находится в разработке, не используется в системах,
																								Действующий - формат запущен в эксплуатацию</xs:documentation>
																						</xs:annotation>
																						<xs:simpleType>
																							<xs:restriction base="УТ2:ТипНепустаяСтрока">
																								<xs:enumeration value="Проект"/>
																								<xs:enumeration value="Действующий"/>
																							</xs:restriction>
																						</xs:simpleType>
																					</xs:attribute>
																					<xs:attribute name="Экспликация" type="УТ2:ТипНепустаяСтрока">
																						<xs:annotation>
																							<xs:documentation>Имя файла архива экспликации по формату документа. Указывается, если формируется несколько экспликаций по разным форматам одного типа документа</xs:documentation>
																						</xs:annotation>
																					</xs:attribute>
																				</xs:complexType>
																			</xs:element>																			
																		</xs:sequence>
																		<xs:attribute name="Код" type="УТ2:ТипНепустаяСтрока" use="required">
																			<xs:annotation>
																				<xs:documentation>Код типа документа</xs:documentation>
																			</xs:annotation>
																		</xs:attribute>
																		<xs:attribute name="Наименование" type="УТ2:ТипНепустаяСтрока" use="required">
																			<xs:annotation>
																				<xs:documentation>Наименование типа документа</xs:documentation>
																			</xs:annotation>
																		</xs:attribute>
																		<xs:attribute name="Описание" type="УТ2:ТипНепустаяСтрока" use="required">
																			<xs:annotation>
																				<xs:documentation>Краткое описание типа документа</xs:documentation>
																			</xs:annotation>
																		</xs:attribute>
																		<xs:attribute name="Экспликация" type="УТ2:ТипНепустаяСтрока">
																			<xs:annotation>
																				<xs:documentation>Имя файла архива экспликации по типу документа. Указывается, если формируется экпликация только по одному формату типа документа</xs:documentation>
																			</xs:annotation>
																		</xs:attribute>
																		<xs:attribute name="КлючевыеСлова" type="УТ2:ТипНепустаяСтрока" use="required">
																			<xs:annotation>
																				<xs:documentation>Перечень ключевых слова, относящихся к типу документа. Указываются через запятую без пробелов</xs:documentation>
																			</xs:annotation>
																		</xs:attribute>
																	</xs:complexType>																	
																</xs:element>
															</xs:sequence>
															<xs:attribute name="Наименование" type="УТ2:ТипНепустаяСтрока" use="required">
																<xs:annotation>
																	<xs:documentation>Наименование информационного обмена</xs:documentation>
																</xs:annotation>
															</xs:attribute>
														</xs:complexType>
														<xs:unique name="UniqueDocTypeCode">
															<xs:annotation>
																<xs:documentation>Код типа документа должен быть уникален в рамках каталога</xs:documentation>
															</xs:annotation>
															<xs:selector xpath="МАФ:ТипДокумента"/>
															<xs:field xpath="@Код"/>
														</xs:unique>
													</xs:element>													
												</xs:sequence>
												<xs:attribute name="Код" type="УТ2:ТипНепустаяСтрока" use="required">
													<xs:annotation>
														<xs:documentation>Код информационного обмена</xs:documentation>
													</xs:annotation>
												</xs:attribute>
												<xs:attribute name="Наименование" type="УТ2:ТипНепустаяСтрока" use="required">
													<xs:annotation>
														<xs:documentation>Наименование информационного обмена</xs:documentation>
													</xs:annotation>
												</xs:attribute>
												<xs:attribute name="Описание" type="УТ2:ТипНепустаяСтрока" use="required">
													<xs:annotation>
														<xs:documentation>Краткое описание информационного обмена</xs:documentation>
													</xs:annotation>
												</xs:attribute>
												<xs:attribute name="Экспликация" type="УТ2:ТипНепустаяСтрока" use="required">
													<xs:annotation>
														<xs:documentation>Имя файла архива экспликации по информационному обмену</xs:documentation>
													</xs:annotation>
												</xs:attribute>
											</xs:complexType>
											<xs:unique name="UniqueCatalogName">
												<xs:annotation>
													<xs:documentation>Наименование каталога должно быть уникальным в рамках информационного обмена</xs:documentation>
												</xs:annotation>
												<xs:selector xpath="МАФ:Каталог"/>
												<xs:field xpath="@Наименование"/>
											</xs:unique>
										</xs:element>										
									</xs:sequence>
									<xs:attribute name="Код" type="УТ2:ТипНепустаяСтрока" use="required">
										<xs:annotation>
											<xs:documentation>Код направления</xs:documentation>
										</xs:annotation>
									</xs:attribute>
									<xs:attribute name="Наименование" type="УТ2:ТипНепустаяСтрока" use="required">
										<xs:annotation>
											<xs:documentation>Наименование направления</xs:documentation>
										</xs:annotation>
									</xs:attribute>
									<xs:attribute name="Описание" type="УТ2:ТипНепустаяСтрока" use="required">
										<xs:annotation>
											<xs:documentation>Краткое описание направления (полное наименование)</xs:documentation>
										</xs:annotation>
									</xs:attribute>
								</xs:complexType>
								<xs:unique name="UniqueIOCode">
									<xs:annotation>
										<xs:documentation>Код информационного обмена должен быть уникален в рамках направления</xs:documentation>
									</xs:annotation>
									<xs:selector xpath="МАФ:ИО"/>
									<xs:field xpath="@Код"/>
								</xs:unique>
							</xs:element>
						</xs:sequence>
						<xs:attribute name="Тип" type="УТ2:ТипНепустаяСтрока" use="required">
							<xs:annotation>
								<xs:documentation>Код Альбома форматов. Указывается код Альбома форматов, к которому относятся экспликации</xs:documentation>
							</xs:annotation>
						</xs:attribute>
					</xs:complexType>
					<xs:unique name="UniqueDirectionCode">
						<xs:annotation>
							<xs:documentation>Код направления должен быть уникален в рамках альбома форматов</xs:documentation>
						</xs:annotation>
						<xs:selector xpath="МАФ:Направление"/>
						<xs:field xpath="@Код"/>
					</xs:unique>
				</xs:element>
				<xs:element name="СлужебнаяИнформация" type="АФ5:ТипСлужебнаяИнформация">
					<xs:annotation>
						<xs:documentation>Служебная информация об электронном документе</xs:documentation>
					</xs:annotation>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>