﻿<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output version="4.0" method="html" indent="no" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
	<xsl:param name="SV_OutputFormat" select="'HTML'"/>
	<xsl:variable name="XML1" select="/"/>
	<xsl:decimal-format decimal-separator="," grouping-separator=" "/>
	<xsl:template match="/">
		<html>
			<head>
				<title/>
				<meta http-equiv="X-UA-Compatible" content="IE=5"/>
				<style type="text/css">
					@page 
					{
					margin-left:0.6in;
					margin-right:0.6in;
					margin-top:0.79in;
					margin-bottom:0.79in;
					}
					td
					{
					padding-top:1px;
					padding-right:3px;
					padding-bottom:1px;
					padding-left:3px;
					}
					.t1
					{
					font-size:8pt;
					}
					.h1
					{
					background-color:#B0C4DE;
					font-size:14pt;
					font-weight:bold;
					text-align:center;
					}
					.h2
					{
					background-color:#FFFAF0;
					font-size:11pt;
					font-weight:bold;
					text-align:center;
					}
					.h3
					{
					background-color:#E6E6FA;
					text-align:center;
					vertical-align:top;
					font-size:9pt;
					font-weight:bold;
					}
					.h4
					{
					background-color:#E6E6FA;
					text-align:center;
					vertical-align:top;
					font-size:7pt;
					font-weight:bold;
					}
					table
					{
					border-collapse:collapse;
					border-bottom:0;
					border-left:0;
					border-top:0;
					border-right:0;
					background-color:#FFFAF0;
					color:#191970;
					font-size:7pt;
					font-weight:400;
					font-style:normal;
					font-family:"Arial";
					word-wrap:break-word;
					}</style>
			</head>
			<body>
				<xsl:variable name="var" select="RTS_DOC/DOC_REQUISITES/@SENDER_ID"/>
				<xsl:choose>
					<xsl:when test="$var='MFBIM'">
						<xsl:for-each select="$XML1">
							<xsl:for-each select="RTS_DOC">
								<div>
									<xsl:for-each select="DOC_REQUISITES">
										<table width="100%" style="background=#FFFAF0; color=#191970; font-size:11; word-wrap:break-word; border:0; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0;" border="1">
											<tr style="text-align:center; vertical-align:Center; word-wrap:break-word; font-size:15; font-weight:bold; color:#191970; background= #B0C4DE;">
												<th colspan="5">
													<xsl:choose>
														<xsl:when test="@SENDER_NAME!=''">
															<span>
																<xsl:value-of select="@SENDER_NAME"/>
															</span>
														</xsl:when>
														<xsl:otherwise>
															<xsl:text>Публичное акционерное общество Клиринговый центр МФБ</xsl:text>
														</xsl:otherwise>
													</xsl:choose>
												</th>
											</tr>
											<tr style="background=#E6E6FA; text-align:center;">
												<td width="27%">
													<xsl:text>Документ</xsl:text>
												</td>
												<td width="7%">
													<xsl:text>Тип</xsl:text>
												</td>
												<td width="15%">
													<xsl:text>ID фирмы-отправителя</xsl:text>
												</td>
												<td>
													<xsl:text>Код ЭДО РТС получателя</xsl:text>
												</td>
												<td rowspan="2" style="font-style:italic; text-align:left; vertical-align:top; background=#FFFAF0;">
													<span style="font-weight:bold;">
														<xsl:text>Примечание: </xsl:text>
													</span>
													<xsl:for-each select="@REMARKS">
														<xsl:value-of select="string(.)"/>
													</xsl:for-each>
												</td>
											</tr>
											<tr style="text-align:center">
												<td>
													<xsl:for-each select="@DOC_NO">
														<xsl:value-of select="string(.)"/>
													</xsl:for-each>
													<xsl:text> от </xsl:text>
													<xsl:for-each select="@DOC_DATE">
														<xsl:variable name="seqContentStrings_0">
															<xsl:value-of select="format-number(number(substring(string(string(.)), 9, 2)), '00')"/>
															<xsl:text>-</xsl:text>
															<xsl:value-of select="format-number(number(substring(string(string(.)), 6, 2)), '00')"/>
															<xsl:text>-</xsl:text>
															<xsl:value-of select="format-number(number(substring(string(string(string(.))), 1, 4)), '0000')"/>
														</xsl:variable>
														<xsl:variable name="sContent_0" select="string($seqContentStrings_0)"/>
														<xsl:value-of select="$sContent_0"/>
													</xsl:for-each>
													<xsl:text> </xsl:text>
													<xsl:for-each select="@DOC_TIME">
														<xsl:value-of select="string(.)"/>
													</xsl:for-each>
													<xsl:text> (MSK)</xsl:text>
												</td>
												<td>
													<xsl:for-each select="@DOC_TYPE_ID">
														<xsl:value-of select="string(.)"/>
													</xsl:for-each>
												</td>
												<td>
													<xsl:for-each select="@SENDER_ID">
														<xsl:value-of select="string(.)"/>
													</xsl:for-each>
												</td>
												<td>
													<xsl:for-each select="@RECEIVER_ID">
														<xsl:value-of select="string(.)"/>
													</xsl:for-each>
												</td>
											</tr>
										</table>
									</xsl:for-each>
								</div>
								<xsl:for-each select="MFB13">
									<table width="100%" style="background=#FFFAF0; color=#191970; font-size:11; word-wrap:break-word; border:0; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0;" border="1">
										<th colspan="7" style="text-align:center; vertical-align:Center; word-wrap:break-word; font-size:15; font-weight:bold; color:#191970; background= #B0C4DE;">
											<xsl:choose>
												<xsl:when test="@ReportDesc!=''">
													<span>
														<xsl:value-of select="@ReportDesc"/>
													</span>
												</xsl:when>
												<xsl:otherwise>
													<xsl:text>Отчет о позициях поставкой сегодня</xsl:text>
												</xsl:otherwise>
											</xsl:choose>
										</th>
										<tr style="text-align:center;">
											<td width="17%" style="background=#E6E6FA;">
												<xsl:text>Дата отчета:</xsl:text>
											</td>
											<td width="10%" style="background=#E6E6FA;">
												<xsl:text>ID уч. клиринга:</xsl:text>
											</td>
											<td colspan="2" width="auto" style="background=#E6E6FA;">
												<xsl:text>Наим. уч. клиринга:</xsl:text>
											</td>
										</tr>
										<tr>
											<td style="text-align:center;">
												<xsl:for-each select="@ReportDate">
													<span>
														<xsl:variable name="seqContentStrings_1">
															<xsl:value-of select="format-number(number(substring(string(string(.)), 9, 2)), '00')"/>
															<xsl:text>-</xsl:text>
															<xsl:value-of select="format-number(number(substring(string(string(.)), 6, 2)), '00')"/>
															<xsl:text>-</xsl:text>
															<xsl:value-of select="format-number(number(substring(string(string(string(.))), 1, 4)), '0000')"/>
														</xsl:variable>
														<xsl:variable name="sContent_1" select="string($seqContentStrings_1)"/>
														<xsl:value-of select="$sContent_1"/>
													</span>
												</xsl:for-each>
												<xsl:for-each select="@Weekday">
													<span>
														<xsl:text> (</xsl:text>
														<xsl:value-of select="string(.)"/>
														<xsl:text>)</xsl:text>
													</span>
												</xsl:for-each>
											</td>
											<td style="text-align:center;">
												<xsl:for-each select="@MainFirmId">
													<xsl:value-of select="string(.)"/>
												</xsl:for-each>
											</td>
											<td colspan="2" style="text-align:center;">
												<xsl:for-each select="@FirmName">
													<xsl:value-of select="string(.)"/>
												</xsl:for-each>
											</td>
										</tr>
									</table>
									<br/>
									<!--Проверка на версионность, и разветвление на разные типы отчетов -->
									<xsl:choose>
										<xsl:when test="@ReportVersion=4">
											<xsl:for-each select="FIRM">
												<table width="70%" style="background-color=#FFFAF0; word-wrap:break-word; border:0; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0;" border="1">
													<tr>
														<td width="36%" style="background-color= #B0C4DE;">
															<xsl:text>Участник торгов</xsl:text>
														</td>
														<td width="" style="background-color= #B0C4DE;">
															<xsl:text>Наименование участника торгов</xsl:text>
														</td>
													</tr>
													<tr>
														<td style="font-size:12;">
															<xsl:for-each select="@FirmID">
																<xsl:value-of select="string(.)"/>
															</xsl:for-each>
														</td>
														<td style="font-size:12; ">
															<xsl:for-each select="../@FirmName">
																<xsl:value-of select="string(.)"/>
															</xsl:for-each>
														</td>
													</tr>
												</table>
												<br/>
												<xsl:for-each select="CLEARINGTYPE">
													<xsl:for-each select="SESSION">
														<table width="100%" style="background-color=#FFFAF0; word-wrap:break-word; border:0; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0;" border="1">
															<tr>
																<td colspan="1" style="font-size:12;  background-color= #B0C4DE; font-weight:bold">
																	<xsl:text>Тип клирингового пула:</xsl:text>
																</td>
																<td width="55%" colspan="2" style="font-size:12;  ; font-weight:bold ">
																	<xsl:choose>
																		<xsl:when test="../@ClearingType='I'">
																			<xsl:text>Клиринг по Договорам размещения и выкупа</xsl:text>
																		</xsl:when>
																		<xsl:when test="../@ClearingType='C'">
																			<xsl:text>Расчетный клиринговый пул</xsl:text>
																		</xsl:when>
																		<xsl:when test="../@ClearingType='D'">
																			<xsl:text>Клиринговый пул по Договорам с полным обеспечением с ЦК и клирингового пула по Договорам с полным обеспечением без ЦК</xsl:text>
																		</xsl:when>
																	</xsl:choose>
																</td>
																<td colspan="2" style="font-size:12; ">
																	<xsl:choose>
																		<xsl:when test="@FinalObligations='Y'">
																			<xsl:text>Итоги формирования клирингового пула</xsl:text>
																		</xsl:when>
																		<xsl:when test="@FinalObligations='N'">
																			<xsl:text>Предварительно сформированный клиринговый пул</xsl:text>
																		</xsl:when>
																	</xsl:choose>
																</td>
																<td colspan="2" style="font-size:12; font-weight:bold; background-color= #B0C4DE; ">
																	<xsl:text>Дата и время формирования клирингового пула (MSK): </xsl:text>
																</td>
																<td colspan="2">
																	<xsl:value-of select="@ClearingTime"/>
																</td>
															</tr>
															<xsl:for-each select="SETTLE">
																<table width="100%" style="background-color=#FFFAF0; word-wrap:break-word; border:0; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0;" border="1">
																	<tr>
																		<td colspan="2" style="font-size:12;  background-color= #B0C4DE; font-weight:bold;">
																			<xsl:text>Код ТКС</xsl:text>
																		</td>
																		<td colspan="2" style="font-size:12; font-weight:bold;">
																			<xsl:value-of select="@ClrAccCode"/>
																		</td>
																		<td colspan="2" style="font-size:12; background-color= #FFFAF0; font-weight:bold;">
																			<xsl:text>Срок исполнения обязательств</xsl:text>
																		</td>
																		<td colspan="2" style="font-size:12; font-weight:bold;">
																			<xsl:value-of select="../../../../@ReportDate"/>
																		</td>
																	</tr>
																	<xsl:for-each select="POSTYPES">
																		<xsl:choose>
																			<xsl:when test="@PosType = 'C'">
																				<tr style="text-align:left; vertical-align:top; word-wrap:break-word; color:#191970; background-color=#E6E6FA;">
																					<td width="10%">
																						<xsl:text>Обязательства по денежным средства</xsl:text>
																					</td>
																					<td colspan="2" width="20%">
																						<xsl:text>Код клирингового регистра </xsl:text>
																					</td>
																					<td width="35%">
																						<xsl:text>Наименование валюты обязательства</xsl:text>
																					</td>
																					<td>
																						<xsl:text>Код валюты обязательства</xsl:text>
																					</td>
																					<td>
																						<xsl:text>Нетто-обязательство</xsl:text>
																					</td>
																					<td>
																						<xsl:text>Нетто-требование</xsl:text>
																					</td>
																					<td>
																						<xsl:text>Размер нехватки денежных средств для поставки</xsl:text>
																					</td>
																				</tr>
																			</xsl:when>
																			<xsl:when test="@PosType = 'S'">
																				<tr style="text-align:left; vertical-align:top; word-wrap:break-word; color:#191970; background-color=#E6E6FA;">
																					<td width="10%">
																						<xsl:text>Обязательства по ЦБ</xsl:text>
																					</td>
																					<td style="background-color= #E6E6FA;">
																						<xsl:text>Код счета депо </xsl:text>
																					</td>
																					<td>
																						<xsl:text>Код ценной бумаги</xsl:text>
																					</td>
																					<td>
																						<xsl:text>Наименование эмитента ценной бумаги</xsl:text>
																					</td>
																					<td>
																						<xsl:text>Код валюты расчетов по обязательству</xsl:text>
																					</td>
																					<td>
																						<xsl:text>Нетто-обязательство</xsl:text>
																					</td>
																					<td>
																						<xsl:text>Нетто-требование</xsl:text>
																					</td>
																					<td>
																						<xsl:text>Размер нехватки ценных бумаг для поставки</xsl:text>
																					</td>
																				</tr>
																			</xsl:when>
																		</xsl:choose>
																		<xsl:for-each select="GROUP">
																			<xsl:for-each select="RECORDS">
																				<tr style="vertical-align:top; ">
																					<td/>
																					<xsl:choose>
																						<xsl:when test="../../@PosType = 'C'">
																							<td colspan="2" style="border-bottom:0; border-top:0; ">
																								<xsl:for-each select="../@BankAccCode">
																									<xsl:value-of select="string(.) "/>
																								</xsl:for-each>
																							</td>
																							<td style="border-bottom:0; border-top:0; text-align:right; ">
																								<xsl:for-each select="@CurrencyName">
																									<xsl:value-of select="string(.) "/>
																								</xsl:for-each>
																							</td>
																							<td style="border-bottom:0; border-top:0; text-align:right; ">
																								<xsl:for-each select="@CurrencyId">
																									<xsl:value-of select="string(.) "/>
																								</xsl:for-each>
																							</td>
																						</xsl:when>
																						<xsl:when test="../../@PosType = 'S'">
																							<td style="border-bottom:0; border-top:0; ">
																								<xsl:for-each select="../@GuarDepUnitId">
																									<xsl:value-of select="string(.) "/>
																								</xsl:for-each>
																							</td>
																							<td style="border-bottom:0; border-top:0; text-align:right; ">
																								<xsl:for-each select="@SecurityId">
																									<xsl:value-of select="string(.) "/>
																								</xsl:for-each>
																							</td>
																							<td style="border-bottom:0; border-top:0; text-align:right; ">
																								<xsl:for-each select="@SecShortName">
																									<xsl:value-of select="string(.) "/>
																								</xsl:for-each>
																							</td>
																							<td style="border-bottom:0; border-top:0; text-align:right; ">
																								<xsl:for-each select="@CurrencyId">
																									<xsl:value-of select="string(.) "/>
																								</xsl:for-each>
																							</td>
																						</xsl:when>
																					</xsl:choose>
																					<td style="border-bottom:0; border-top:0; text-align:right; ">
																						<xsl:for-each select="@Debit">
																							<xsl:value-of select="format-number(string(.),'### ### ##0,00')"/>
																						</xsl:for-each>
																					</td>
																					<td style="border-bottom:0; border-top:0; text-align:right; ">
																						<xsl:for-each select="@Credit">
																							<xsl:value-of select="format-number(string(.),'### ### ##0,00')"/>
																						</xsl:for-each>
																					</td>
																					<td style="border-bottom:0; border-top:0; text-align:right; ">
																						<xsl:for-each select="@Shortage">
																							<xsl:value-of select="format-number(string(.),'### ### ##0,00')"/>
																						</xsl:for-each>
																					</td>
																				</tr>
																				<tr>
																					<td colspan="7" style="border-bottom:0; border-left:0; border-right:0; font:10; font-weight:bold; height:1; line-height:1; text-align:left; "/>
																				</tr>
																			</xsl:for-each>
																			<!--RECORDS-->
																		</xsl:for-each>
																		<!--GROUP-->
																	</xsl:for-each>
																	<!--POSTYPES-->
																</table>
															</xsl:for-each>
															<!--SETTLE-->
															<BR/>
														</table>
													</xsl:for-each>
													<!--SESSION-->
												</xsl:for-each>
												<!--CLEARINGTYPE-->
											</xsl:for-each>
											<!--FIRM-->
										</xsl:when>
										<xsl:when test="@ReportVersion=2">
											<xsl:for-each select="FIRM">
												<table width="55%" style="background=#FFFAF0; word-wrap:break-word; border:0; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0;" border="1">
													<tr>
														<td width="36%" style="background= #B0C4DE;">
															<xsl:text>Участник торгов</xsl:text>
														</td>
														<td width="" style="background= #B0C4DE;">
															<xsl:text>Наименование участника торгов</xsl:text>
														</td>
													</tr>
													<tr>
														<td style="font-size:12;">
															<xsl:for-each select="@FirmID">
																<xsl:value-of select="string(.)"/>
															</xsl:for-each>
														</td>
														<td style="font-size:12; ">
															<xsl:for-each select="../@FirmName">
																<xsl:value-of select="string(.)"/>
															</xsl:for-each>
														</td>
													</tr>
												</table>
												<br/>
												<xsl:for-each select="SETTLE">
													<table width="20%" style="background=#FFFAF0; word-wrap:break-word; border:0; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0;" border="1">
														<tr>
															<td style="font-size:12; background= #B0C4DE; font-weight:bold">
																<xsl:text>Код ТКС</xsl:text>
															</td>
														</tr>
														<tr>
															<td style="font-size:12; font-weight:bold ">
																<xsl:for-each select="@ClrAccCode">
																	<xsl:value-of select="string(.)"/>
																</xsl:for-each>
															</td>
														</tr>
													</table>
													<xsl:for-each select="SETTLEDATE">
														<table width="100%" style="background=#FFFAF0; color=#191970; word-wrap:break-word; border:0; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0;" border="1">
															<tr style="text-align:center; vertical-align:top; word-wrap:break-word; color:#191970; background=#E6E6FA;">
																<td width="20%" style="background= #B0C4DE;">
																	<xsl:text>Срок исполнения обязательств на</xsl:text>
																</td>
																<td width="20%" style="background= #B0C4DE;">
																	<xsl:text>Код раздела регистра внутреннего учета: </xsl:text>
																</td>
																<td width="15%">
																	<xsl:text>Тип обязательств</xsl:text>
																</td>
																<td>
																	<xsl:text>Код валюты/Краткий код бумаги</xsl:text>
																</td>
																<td>
																	<xsl:text>Нетто-обязательство</xsl:text>
																</td>
																<td>
																	<xsl:text>Нетто-требование</xsl:text>
																</td>
																<td>
																	<xsl:text>Размер нехватки активов для поставки</xsl:text>
																</td>
															</tr>
															<xsl:for-each select="POSTYPES">
																<xsl:for-each select="GROUP">
																	<xsl:for-each select="RECORDS">
																		<tr style="vertical-align:top; ">
																			<td style="border-bottom:0; border-top:0; ">
																				<xsl:for-each select="../../../@SettleDate">
																					<xsl:variable name="seqContentStrings_2">
																						<xsl:value-of select="format-number(number(substring(string(string(.)), 9, 2)), '00')"/>
																						<xsl:text>-</xsl:text>
																						<xsl:value-of select="format-number(number(substring(string(string(.)), 6, 2)), '00')"/>
																						<xsl:text>-</xsl:text>
																						<xsl:value-of select="format-number(number(substring(string(string(string(.))), 1, 4)), '0000')"/>
																					</xsl:variable>
																					<xsl:variable name="sContent_2" select="string($seqContentStrings_2)"/>
																					<xsl:value-of select="$sContent_2"/>
																				</xsl:for-each>
																			</td>
																			<xsl:choose>
																				<xsl:when test="../../@PosType = 'C'">
																					<td style="border-bottom:0; border-top:0; ">
																						<xsl:for-each select="../@BankAccCode">
																							<xsl:value-of select="string(.) "/>
																						</xsl:for-each>
																					</td>
																				</xsl:when>
																				<xsl:when test="../../@PosType = 'S'">
																					<td style="border-bottom:0; border-top:0; ">
																						<xsl:for-each select="../@GuarDepUnitId">
																							<xsl:value-of select="string(.) "/>
																						</xsl:for-each>
																					</td>
																				</xsl:when>
																			</xsl:choose>
																			<td style="border-bottom:0; border-top:0; ">
																				<xsl:choose>
																					<xsl:when test="@DataType='TRADE'">
																						<xsl:text>по Договорам</xsl:text>
																					</xsl:when>
																					<xsl:when test="@DataType='FEE'">
																						<xsl:text>по комиссии с уплатой в день исполнения Договора</xsl:text>
																					</xsl:when>
																					<xsl:when test="@DataType='DIVIDEND'">
																						<span>
																							<xsl:text>по возврату дивидендов по сделкам РЕПО</xsl:text>
																						</span>
																					</xsl:when>
																				</xsl:choose>
																			</td>
																			<xsl:choose>
																				<xsl:when test="../../@PosType = 'S'">
																					<td style="border-bottom:0; border-top:0; text-align:right; ">
																						<xsl:for-each select="@SecurityId">
																							<xsl:value-of select="string(.) "/>
																						</xsl:for-each>
																					</td>
																				</xsl:when>
																				<xsl:when test="../../@PosType = 'C'">
																					<td style="border-bottom:0; border-top:0; text-align:right; ">
																						<xsl:for-each select="@CurrencyId">
																							<xsl:value-of select="string(.) "/>
																						</xsl:for-each>
																					</td>
																				</xsl:when>
																			</xsl:choose>
																			<td style="border-bottom:0; border-top:0; text-align:right; ">
																				<xsl:for-each select="@Debit">
																					<xsl:value-of select="format-number(string(.),'### ### ##0,00')"/>
																				</xsl:for-each>
																			</td>
																			<td style="border-bottom:0; border-top:0; text-align:right; ">
																				<xsl:for-each select="@Credit">
																					<xsl:value-of select="format-number(string(.),'### ### ##0,00')"/>
																				</xsl:for-each>
																			</td>
																			<td style="border-bottom:0; border-top:0; text-align:right; ">
																				<xsl:for-each select="@Shortage">
																					<xsl:value-of select="format-number(string(.),'### ### ##0,00')"/>
																				</xsl:for-each>
																			</td>
																		</tr>
																		<tr>
																			<td colspan="7" style="border-bottom:0; border-left:0; border-right:0; font:10; font-weight:bold; height:1; line-height:1; text-align:left; "/>
																		</tr>
																	</xsl:for-each>
																	<!--RECORDS-->
																</xsl:for-each>
																<!--GROUP-->
															</xsl:for-each>
															<!--POSTYPES-->
														</table>
													</xsl:for-each>
													<!--SETTLEDATE-->
													<BR/>
												</xsl:for-each>
												<!--SETTLE-->
											</xsl:for-each>
											<!--FIRM-->
										</xsl:when>
										<xsl:otherwise>
											<xsl:for-each select="FIRM">
												<xsl:for-each select="SETTLE">
													<xsl:for-each select="SETTLEDATE">
														<xsl:for-each select="POSTYPES">
															<xsl:for-each select="GROUP">
																<table width="1000" style="background=#FFFAF0; color=#191970; font-size:11; word-wrap:break-word; border:0; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0;" border="1">
																	<tr>
																		<td colspan="2" style="background= #B0C4DE; color=#191970">
																			<xsl:text>Участник торгов:</xsl:text>
																		</td>
																		<td width="5%">
																			<xsl:for-each select="../../../../@FirmID">
																				<xsl:value-of select="string(.)"/>
																			</xsl:for-each>
																		</td>
																		<td style="background= #B0C4DE; color=#191970">
																			<xsl:text>Код ТКС:</xsl:text>
																		</td>
																		<td colspan="2">
																			<xsl:for-each select="../../../@ClrAccCode">
																				<xsl:value-of select="string(.) "/>
																			</xsl:for-each>
																		</td>
																		<td style="background= #B0C4DE; color=#191970">
																			<xsl:text>Дата исполнения:</xsl:text>
																		</td>
																		<td>
																			<xsl:for-each select="../../@SettleDate">
																				<xsl:variable name="seqContentStrings_2">
																					<xsl:value-of select="format-number(number(substring(string(string(.)), 9, 2)), '00')"/>
																					<xsl:text>-</xsl:text>
																					<xsl:value-of select="format-number(number(substring(string(string(.)), 6, 2)), '00')"/>
																					<xsl:text>-</xsl:text>
																					<xsl:value-of select="format-number(number(substring(string(string(string(.))), 1, 4)), '0000')"/>
																				</xsl:variable>
																				<xsl:variable name="sContent_2" select="string($seqContentStrings_2)"/>
																				<xsl:value-of select="$sContent_2"/>
																			</xsl:for-each>
																		</td>
																	</tr>
																	<tr>
																		<td colspan="2" style="background= #B0C4DE; color=#191970">
																			<xsl:text>Информация по типам обязательств: </xsl:text>
																		</td>
																		<td colspan="4">
																			<xsl:choose>
																				<xsl:when test="../@PosType = 'C'">
																					<span>
																						<xsl:text>Информация о нетто обязательствах/требованиях по денежной позиции</xsl:text>
																					</span>
																				</xsl:when>
																				<xsl:when test="../@PosType = 'S'">
																					<span>
																						<xsl:text>Информация о нетто обязательствах/требованиях по депозитарным разделам </xsl:text>
																					</span>
																				</xsl:when>
																			</xsl:choose>
																		</td>
																		<xsl:choose>
																			<xsl:when test="../@PosType = 'C'">
																				<td style="background= #B0C4DE; color=#191970">
																					<xsl:text>Код денежного регистра: </xsl:text>
																				</td>
																				<td>
																					<xsl:for-each select="@BankAccCode">
																						<xsl:value-of select="string(.) "/>
																					</xsl:for-each>
																				</td>
																			</xsl:when>
																		</xsl:choose>
																		<xsl:choose>
																			<xsl:when test="../@PosType = 'S'">
																				<td style="background= #B0C4DE; color=#191970">
																					<xsl:text>Счет (субсчет) депо для учета ценных бумаг: </xsl:text>
																				</td>
																				<td>
																					<xsl:for-each select="@GuarDepUnitId">
																						<xsl:value-of select="string(.) "/>
																					</xsl:for-each>
																				</td>
																			</xsl:when>
																		</xsl:choose>
																	</tr>
																</table>
																<table width="1000" style="background=#FFFAF0; color=#191970; border:1; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0; border-top:0; font-family:Arial; font-size:9; word-wrap:break-word;" border="1">
																	<thead style="text-align:center; word-wrap:break-word; ">
																		<tr style="text-align:center; vertical-align:top; word-wrap:break-word; color:#191970; background=#E6E6FA;">
																			<th>
																				<xsl:text>Тип обязательств</xsl:text>
																			</th>
																			<xsl:choose>
																				<xsl:when test="../@PosType = 'S'">
																					<th>
																						<xsl:text>Идентификатор валюты расчётов</xsl:text>
																					</th>
																					<th>
																						<xsl:text>Наименование валюты расчётов</xsl:text>
																					</th>
																					<th>
																						<xsl:text>Идентификатор инструмента</xsl:text>
																					</th>
																					<th>
																						<xsl:text>Краткое наименование инструмента</xsl:text>
																					</th>
																				</xsl:when>
																				<xsl:when test="../@PosType = 'C'">
																					<th>
																						<xsl:text>Идентификатор валюты</xsl:text>
																					</th>
																					<th>
																						<xsl:text>Наименование валюты</xsl:text>
																					</th>
																				</xsl:when>
																			</xsl:choose>
																			<th>
																				<xsl:text>Нетто-обязательство</xsl:text>
																			</th>
																			<th>
																				<xsl:text>Нетто-требование</xsl:text>
																			</th>
																		</tr>
																	</thead>
																	<tbody>
																		<xsl:for-each select="RECORDS">
																			<tr style="vertical-align:top; ">
																				<td style="border-bottom:0; border-top:0; text-align:right; ">
																					<xsl:choose>
																						<xsl:when test="@DataType='TRADE'">
																							<span>
																								<xsl:text>по Договорам</xsl:text>
																							</span>
																						</xsl:when>
																						<xsl:when test="@DataType='FEE'">
																							<span>
																								<xsl:text>по оборотной части комиссионного вознаграждения с уплатой в день исполнения Договора</xsl:text>
																							</span>
																						</xsl:when>
																					</xsl:choose>
																				</td>
																				<td style="border-bottom:0; border-top:0; text-align:right; ">
																					<xsl:for-each select="@CurrencyId">
																						<xsl:value-of select="string(.) "/>
																					</xsl:for-each>
																				</td>
																				<td style="border-bottom:0; border-top:0; text-align:right; ">
																					<xsl:for-each select="@CurrencyName">
																						<xsl:value-of select="string(.) "/>
																					</xsl:for-each>
																				</td>
																				<xsl:choose>
																					<xsl:when test="../../@PosType = 'S'">
																						<td style="border-bottom:0; border-top:0; text-align:right; ">
																							<xsl:for-each select="@SecurityId">
																								<xsl:value-of select="string(.) "/>
																							</xsl:for-each>
																						</td>
																						<td style="border-bottom:0; border-top:0; text-align:right; ">
																							<xsl:for-each select="@SecShortName">
																								<xsl:value-of select="string(.) "/>
																							</xsl:for-each>
																						</td>
																					</xsl:when>
																				</xsl:choose>
																				<td style="border-bottom:0; border-top:0; text-align:right; ">
																					<xsl:for-each select="@Debit">
																						<xsl:value-of select="string(.) "/>
																					</xsl:for-each>
																				</td>
																				<td style="border-bottom:0; border-top:0; text-align:right; ">
																					<xsl:for-each select="@Credit">
																						<xsl:value-of select="string(.) "/>
																					</xsl:for-each>
																				</td>
																			</tr>
																			<tr>
																				<td colspan="7" style="border-bottom:0; border-left:0; border-right:0; font:10; font-weight:bold; height:1; line-height:1; text-align:left; "/>
																			</tr>
																		</xsl:for-each>
																	</tbody>
																</table>
																<br/>
															</xsl:for-each>
														</xsl:for-each>
													</xsl:for-each>
												</xsl:for-each>
											</xsl:for-each>
										</xsl:otherwise>
									</xsl:choose>
								</xsl:for-each>
							</xsl:for-each>
						</xsl:for-each>
					</xsl:when>
					<xsl:otherwise>
						<xsl:for-each select="$XML1">
							<xsl:for-each select="RTS_DOC">
								<div>
									<xsl:for-each select="DOC_REQUISITES">
										<table width="100%" style="background=#FFFAF0; color=#191970; font-size:11; word-wrap:break-word; border:0; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0;" border="1">
											<tr style="text-align:center; vertical-align:Center; word-wrap:break-word; font-size:15; font-weight:bold; color:#191970; background= #B0C4DE;">
												<th colspan="5">
													<xsl:choose>
														<xsl:when test="@SENDER_NAME!=''">
															<span>
																<xsl:value-of select="@SENDER_NAME"/>
															</span>
														</xsl:when>
														<xsl:otherwise>
															<xsl:text>Central Counterparty «SPB Clearing» (joint-stock company)</xsl:text>
														</xsl:otherwise>
													</xsl:choose>
												</th>
											</tr>
											<tr style="background=#E6E6FA; text-align:center;">
												<td width="27%">
													<xsl:text>Document</xsl:text>
												</td>
												<td width="7%">
													<xsl:text>Type</xsl:text>
												</td>
												<td width="15%">
													<xsl:text>Sender ID</xsl:text>
												</td>
												<td>
													<xsl:text>Recipient's code in the Electronic Document Management System</xsl:text>
												</td>
												<td rowspan="2" style="font-style:italic; text-align:left; vertical-align:top; background=#FFFAF0;">
													<span style="font-weight:bold;">
														<xsl:text>Notes to the document: </xsl:text>
													</span>
													<xsl:for-each select="@REMARKS">
														<xsl:value-of select="string(.)"/>
													</xsl:for-each>
												</td>
											</tr>
											<tr style="text-align:center">
												<td>
													<xsl:for-each select="@DOC_NO">
														<xsl:value-of select="string(.)"/>
													</xsl:for-each>
													<xsl:text> of </xsl:text>
													<xsl:for-each select="@DOC_DATE">
														<xsl:variable name="seqContentStrings_0">
															<xsl:value-of select="format-number(number(substring(string(string(.)), 9, 2)), '00')"/>
															<xsl:text>-</xsl:text>
															<xsl:value-of select="format-number(number(substring(string(string(.)), 6, 2)), '00')"/>
															<xsl:text>-</xsl:text>
															<xsl:value-of select="format-number(number(substring(string(string(string(.))), 1, 4)), '0000')"/>
														</xsl:variable>
														<xsl:variable name="sContent_0" select="string($seqContentStrings_0)"/>
														<xsl:value-of select="$sContent_0"/>
													</xsl:for-each>
													<xsl:text> </xsl:text>
													<xsl:for-each select="@DOC_TIME">
														<xsl:value-of select="string(.)"/>
													</xsl:for-each>
													<xsl:text> (MSK)</xsl:text>
												</td>
												<td>
													<xsl:for-each select="@DOC_TYPE_ID">
														<xsl:value-of select="string(.)"/>
													</xsl:for-each>
												</td>
												<td>
													<xsl:for-each select="@SENDER_ID">
														<xsl:value-of select="string(.)"/>
													</xsl:for-each>
												</td>
												<td>
													<xsl:for-each select="@RECEIVER_ID">
														<xsl:value-of select="string(.)"/>
													</xsl:for-each>
												</td>
											</tr>
										</table>
									</xsl:for-each>
								</div>
								<xsl:for-each select="MFB13">
									<table width="100%" style="background=#FFFAF0; color=#191970; font-size:11; word-wrap:break-word; border:0; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0;" border="1">
										<th colspan="7" style="text-align:center; vertical-align:Center; word-wrap:break-word; font-size:15; font-weight:bold; color:#191970; background= #B0C4DE;">
											<xsl:choose>
												<xsl:when test="@ReportDesc!=''">
													<span>
														<xsl:value-of select="@ReportDesc"/>
													</span>
												</xsl:when>
												<xsl:otherwise>
													<xsl:text>Final Net Obligations/Net Claims</xsl:text>
												</xsl:otherwise>
											</xsl:choose>
										</th>
										<tr style="text-align:center;">
											<td width="17%" style="background=#E6E6FA;">
												<xsl:text>Report date:</xsl:text>
											</td>
											<td width="10%" style="background=#E6E6FA;">
												<xsl:text>Clearing Member identifier:</xsl:text>
											</td>
											<td colspan="2" width="auto" style="background=#E6E6FA;">
												<xsl:text>Clearing Member name:</xsl:text>
											</td>
										</tr>
										<tr>
											<td style="text-align:center;">
												<xsl:for-each select="@ReportDate">
													<span>
														<xsl:variable name="seqContentStrings_1">
															<xsl:value-of select="format-number(number(substring(string(string(.)), 9, 2)), '00')"/>
															<xsl:text>-</xsl:text>
															<xsl:value-of select="format-number(number(substring(string(string(.)), 6, 2)), '00')"/>
															<xsl:text>-</xsl:text>
															<xsl:value-of select="format-number(number(substring(string(string(string(.))), 1, 4)), '0000')"/>
														</xsl:variable>
														<xsl:variable name="sContent_1" select="string($seqContentStrings_1)"/>
														<xsl:value-of select="$sContent_1"/>
													</span>
												</xsl:for-each>
												<xsl:for-each select="@Weekday">
													<span>
														<xsl:text> (</xsl:text>
														<xsl:value-of select="string(.)"/>
														<xsl:text>)</xsl:text>
													</span>
												</xsl:for-each>
											</td>
											<td style="text-align:center;">
												<xsl:for-each select="@MainFirmId">
													<xsl:value-of select="string(.)"/>
												</xsl:for-each>
											</td>
											<td colspan="2" style="text-align:center;">
												<xsl:for-each select="@FirmName">
													<xsl:value-of select="string(.)"/>
												</xsl:for-each>
											</td>
										</tr>
									</table>
									<br/>
									<!--Проверка на версионность, и разветвление на разные типы отчетов -->
									<xsl:choose>
										<xsl:when test="@ReportVersion=4">
											<xsl:for-each select="FIRM">
												<table width="70%" style="background-color=#FFFAF0; word-wrap:break-word; border:0; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0;" border="1">
													<tr>
														<td width="36%" style="background-color= #B0C4DE;">
															<xsl:text>Trading Member</xsl:text>
														</td>
														<td width="" style="background-color= #B0C4DE;">
															<xsl:text>Trading Member Name</xsl:text>
														</td>
													</tr>
													<tr>
														<td style="font-size:12;">
															<xsl:for-each select="@FirmID">
																<xsl:value-of select="string(.)"/>
															</xsl:for-each>
														</td>
														<td style="font-size:12; ">
															<xsl:for-each select="../@FirmName">
																<xsl:value-of select="string(.)"/>
															</xsl:for-each>
														</td>
													</tr>
												</table>
												<br/>
												<xsl:for-each select="CLEARINGTYPE">
													<xsl:for-each select="SESSION">
														<table width="100%" style="background-color=#FFFAF0; word-wrap:break-word; border:0; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0;" border="1">
															<tr>
																<td colspan="1" style="font-size:12;  background-color= #B0C4DE; font-weight:bold">
																	<xsl:text>Type of clearing pool:</xsl:text>
																</td>
																<td width="55%" colspan="2" style="font-size:12;  ; font-weight:bold ">
																	<xsl:choose>
																		<xsl:when test="../@ClearingType='I'">
																			<xsl:text>Clearing pool for Intra-Brokerage agreements </xsl:text>
																		</xsl:when>
																		<xsl:when test="../@ClearingType='C'">
																			<xsl:text>Settlement and clearing pool</xsl:text>
																		</xsl:when>
																		<xsl:when test="../@ClearingType='D'">
																			<xsl:text>Clearing pool under fully collaterised agreements</xsl:text>
																		</xsl:when>
																	</xsl:choose>
																</td>
																<td colspan="2" style="font-size:12; ">
																	<xsl:choose>
																		<xsl:when test="@FinalObligations='Y'">
																			<xsl:text>Final net obligations</xsl:text>
																		</xsl:when>
																		<xsl:when test="@FinalObligations='N'">
																			<xsl:text>Final net obligations determined prior to the asset shortage settlement for supply </xsl:text>
																		</xsl:when>
																	</xsl:choose>
																</td>
																<td colspan="2" style="font-size:12; font-weight:bold; background-color= #B0C4DE; ">
																	<xsl:text>Date and time of clearing pool creation (MSK): </xsl:text>
																</td>
																<td colspan="2">
																	<xsl:value-of select="@ClearingTime"/>
																</td>
															</tr>
															<xsl:for-each select="SETTLE">
																<table width="100%" style="background-color=#FFFAF0; word-wrap:break-word; border:0; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0;" border="1">
																	<tr>
																		<td colspan="2" style="font-size:12;  background-color= #B0C4DE; font-weight:bold;">
																			<xsl:text>TCA code</xsl:text>
																		</td>
																		<td colspan="2" style="font-size:12; font-weight:bold;">
																			<xsl:value-of select="@ClrAccCode"/>
																		</td>
																		<td colspan="2" style="font-size:12; background-color= #FFFAF0; font-weight:bold;">
																			<xsl:text>Settlement date</xsl:text>
																		</td>
																		<td colspan="2" style="font-size:12; font-weight:bold;">
																			<xsl:value-of select="../../../../@ReportDate"/>
																		</td>
																	</tr>
																	<xsl:for-each select="POSTYPES">
																		<xsl:choose>
																			<xsl:when test="@PosType = 'C'">
																				<tr style="text-align:left; vertical-align:top; word-wrap:break-word; color:#191970; background-color=#E6E6FA;">
																					<td width="10%">
																						<xsl:text>Information on net obligations/requirements for a cash position</xsl:text>
																					</td>
																					<td colspan="2" width="20%">
																						<xsl:text>Cash Register code</xsl:text>
																					</td>
																					<td width="35%">
																						<xsl:text>Obligation currency name</xsl:text>
																					</td>
																					<td>
																						<xsl:text>Obligation currency identifier</xsl:text>
																					</td>
																					<td>
																						<xsl:text>Net Obligations</xsl:text>
																					</td>
																					<td>
																						<xsl:text>Net Claims</xsl:text>
																					</td>
																					<td>
																						<xsl:text>The amount of shortage of funds for supply</xsl:text>
																					</td>
																				</tr>
																			</xsl:when>
																			<xsl:when test="@PosType = 'S'">
																				<tr style="text-align:left; vertical-align:top; word-wrap:break-word; color:#191970; background-color=#E6E6FA;">
																					<td width="10%">
																						<xsl:text>information on net obligations/claims for depository sections</xsl:text>
																					</td>
																					<td style="background-color= #E6E6FA;">
																						<xsl:text>Custody (sub-account) account for securities record </xsl:text>
																					</td>
																					<td>
																						<xsl:text>Securities identifier</xsl:text>
																					</td>
																					<td>
																						<xsl:text>Short name of the security/issuer of the security</xsl:text>
																					</td>
																					<td>
																						<xsl:text>Obligation currency code</xsl:text>
																					</td>
																					<td>
																						<xsl:text>Net Obligations</xsl:text>
																					</td>
																					<td>
																						<xsl:text>Net Claims</xsl:text>
																					</td>
																					<td>
																						<xsl:text>>The amount of shortage of securities for supply</xsl:text>
																					</td>
																				</tr>
																			</xsl:when>
																		</xsl:choose>
																		<xsl:for-each select="GROUP">
																			<xsl:for-each select="RECORDS">
																				<tr style="vertical-align:top; ">
																					<td/>
																					<xsl:choose>
																						<xsl:when test="../../@PosType = 'C'">
																							<td colspan="2" style="border-bottom:0; border-top:0; ">
																								<xsl:for-each select="../@BankAccCode">
																									<xsl:value-of select="string(.) "/>
																								</xsl:for-each>
																							</td>
																							<td style="border-bottom:0; border-top:0; text-align:right; ">
																								<xsl:for-each select="@CurrencyName">
																									<xsl:value-of select="string(.) "/>
																								</xsl:for-each>
																							</td>
																							<td style="border-bottom:0; border-top:0; text-align:right; ">
																								<xsl:for-each select="@CurrencyId">
																									<xsl:value-of select="string(.) "/>
																								</xsl:for-each>
																							</td>
																						</xsl:when>
																						<xsl:when test="../../@PosType = 'S'">
																							<td style="border-bottom:0; border-top:0; ">
																								<xsl:for-each select="../@GuarDepUnitId">
																									<xsl:value-of select="string(.) "/>
																								</xsl:for-each>
																							</td>
																							<td style="border-bottom:0; border-top:0; text-align:right; ">
																								<xsl:for-each select="@SecurityId">
																									<xsl:value-of select="string(.) "/>
																								</xsl:for-each>
																							</td>
																							<td style="border-bottom:0; border-top:0; text-align:right; ">
																								<xsl:for-each select="@SecShortName">
																									<xsl:value-of select="string(.) "/>
																								</xsl:for-each>
																							</td>
																							<td style="border-bottom:0; border-top:0; text-align:right; ">
																								<xsl:for-each select="@CurrencyId">
																									<xsl:value-of select="string(.) "/>
																								</xsl:for-each>
																							</td>
																						</xsl:when>
																					</xsl:choose>
																					<td style="border-bottom:0; border-top:0; text-align:right; ">
																						<xsl:for-each select="@Debit">
																							<xsl:value-of select="format-number(string(.),'### ### ##0,00')"/>
																						</xsl:for-each>
																					</td>
																					<td style="border-bottom:0; border-top:0; text-align:right; ">
																						<xsl:for-each select="@Credit">
																							<xsl:value-of select="format-number(string(.),'### ### ##0,00')"/>
																						</xsl:for-each>
																					</td>
																					<td style="border-bottom:0; border-top:0; text-align:right; ">
																						<xsl:for-each select="@Shortage">
																							<xsl:value-of select="format-number(string(.),'### ### ##0,00')"/>
																						</xsl:for-each>
																					</td>
																				</tr>
																				<tr>
																					<td colspan="7" style="border-bottom:0; border-left:0; border-right:0; font:10; font-weight:bold; height:1; line-height:1; text-align:left; "/>
																				</tr>
																			</xsl:for-each>
																			<!--RECORDS-->
																		</xsl:for-each>
																		<!--GROUP-->
																	</xsl:for-each>
																	<!--POSTYPES-->
																</table>
															</xsl:for-each>
															<!--SETTLE-->
															<BR/>
														</table>
													</xsl:for-each>
													<!--SESSION-->
												</xsl:for-each>
												<!--CLEARINGTYPE-->
											</xsl:for-each>
											<!--FIRM-->
										</xsl:when>
										<xsl:when test="@ReportVersion=2">
											<xsl:for-each select="FIRM">
												<table width="55%" style="background=#FFFAF0; word-wrap:break-word; border:0; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0;" border="1">
													<tr>
														<td width="36%" style="background= #B0C4DE;">
															<xsl:text>Trading Member</xsl:text>
														</td>
														<td width="" style="background= #B0C4DE;">
															<xsl:text>Trading Member Name</xsl:text>
														</td>
													</tr>
													<tr>
														<td style="font-size:12;">
															<xsl:for-each select="@FirmID">
																<xsl:value-of select="string(.)"/>
															</xsl:for-each>
														</td>
														<td style="font-size:12; ">
															<xsl:for-each select="../@FirmName">
																<xsl:value-of select="string(.)"/>
															</xsl:for-each>
														</td>
													</tr>
												</table>
												<br/>
												<xsl:for-each select="SETTLE">
													<table width="20%" style="background=#FFFAF0; word-wrap:break-word; border:0; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0;" border="1">
														<tr>
															<td style="font-size:12; background= #B0C4DE; font-weight:bold">
																<xsl:text>TCA Code</xsl:text>
															</td>
														</tr>
														<tr>
															<td style="font-size:12; font-weight:bold ">
																<xsl:for-each select="@ClrAccCode">
																	<xsl:value-of select="string(.)"/>
																</xsl:for-each>
															</td>
														</tr>
													</table>
													<xsl:for-each select="SETTLEDATE">
														<table width="100%" style="background=#FFFAF0; color=#191970; word-wrap:break-word; border:0; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0;" border="1">
															<tr style="text-align:center; vertical-align:top; word-wrap:break-word; color:#191970; background=#E6E6FA;">
																<td width="20%" style="background= #B0C4DE;">
																	<xsl:text>Settlement date</xsl:text>
																</td>
																<td width="20%" style="background= #B0C4DE;">
																	<xsl:text>Clearing register of internal accounting code: </xsl:text>
																</td>
																<td width="15%">
																	<xsl:text>Obligation type</xsl:text>
																</td>
																<td>
																	<xsl:text>Currency code/Short code of the security</xsl:text>
																</td>
																<td>
																	<xsl:text>Net Obligations</xsl:text>
																</td>
																<td>
																	<xsl:text>Net Claims</xsl:text>
																</td>
																<td>
																	<xsl:text>Size of asset shortage for supply</xsl:text>
																</td>
															</tr>
															<xsl:for-each select="POSTYPES">
																<xsl:for-each select="GROUP">
																	<xsl:for-each select="RECORDS">
																		<tr style="vertical-align:top; ">
																			<td style="border-bottom:0; border-top:0; ">
																				<xsl:for-each select="../../../@SettleDate">
																					<xsl:variable name="seqContentStrings_2">
																						<xsl:value-of select="format-number(number(substring(string(string(.)), 9, 2)), '00')"/>
																						<xsl:text>-</xsl:text>
																						<xsl:value-of select="format-number(number(substring(string(string(.)), 6, 2)), '00')"/>
																						<xsl:text>-</xsl:text>
																						<xsl:value-of select="format-number(number(substring(string(string(string(.))), 1, 4)), '0000')"/>
																					</xsl:variable>
																					<xsl:variable name="sContent_2" select="string($seqContentStrings_2)"/>
																					<xsl:value-of select="$sContent_2"/>
																				</xsl:for-each>
																			</td>
																			<xsl:choose>
																				<xsl:when test="../../@PosType = 'C'">
																					<td style="border-bottom:0; border-top:0; ">
																						<xsl:for-each select="../@BankAccCode">
																							<xsl:value-of select="string(.) "/>
																						</xsl:for-each>
																					</td>
																				</xsl:when>
																				<xsl:when test="../../@PosType = 'S'">
																					<td style="border-bottom:0; border-top:0; ">
																						<xsl:for-each select="../@GuarDepUnitId">
																							<xsl:value-of select="string(.) "/>
																						</xsl:for-each>
																					</td>
																				</xsl:when>
																			</xsl:choose>
																			<td style="border-bottom:0; border-top:0; ">
																				<xsl:choose>
																					<xsl:when test="@DataType='TRADE'">
																						<xsl:text>under agreements </xsl:text>
																					</xsl:when>
																					<xsl:when test="@DataType='FEE'">
																						<xsl:text>commission fee with payment on the day of agreement performance</xsl:text>
																					</xsl:when>
																					<xsl:when test="@DataType='DIVIDEND'">
																						<span>
																							<xsl:text>for return of dividends on Repurchase transactions </xsl:text>
																						</span>
																					</xsl:when>
																				</xsl:choose>
																			</td>
																			<xsl:choose>
																				<xsl:when test="../../@PosType = 'S'">
																					<td style="border-bottom:0; border-top:0; text-align:right; ">
																						<xsl:for-each select="@SecurityId">
																							<xsl:value-of select="string(.) "/>
																						</xsl:for-each>
																					</td>
																				</xsl:when>
																				<xsl:when test="../../@PosType = 'C'">
																					<td style="border-bottom:0; border-top:0; text-align:right; ">
																						<xsl:for-each select="@CurrencyId">
																							<xsl:value-of select="string(.) "/>
																						</xsl:for-each>
																					</td>
																				</xsl:when>
																			</xsl:choose>
																			<td style="border-bottom:0; border-top:0; text-align:right; ">
																				<xsl:for-each select="@Debit">
																					<xsl:value-of select="format-number(string(.),'### ### ##0,00')"/>
																				</xsl:for-each>
																			</td>
																			<td style="border-bottom:0; border-top:0; text-align:right; ">
																				<xsl:for-each select="@Credit">
																					<xsl:value-of select="format-number(string(.),'### ### ##0,00')"/>
																				</xsl:for-each>
																			</td>
																			<td style="border-bottom:0; border-top:0; text-align:right; ">
																				<xsl:for-each select="@Shortage">
																					<xsl:value-of select="format-number(string(.),'### ### ##0,00')"/>
																				</xsl:for-each>
																			</td>
																		</tr>
																		<tr>
																			<td colspan="7" style="border-bottom:0; border-left:0; border-right:0; font:10; font-weight:bold; height:1; line-height:1; text-align:left; "/>
																		</tr>
																	</xsl:for-each>
																	<!--RECORDS-->
																</xsl:for-each>
																<!--GROUP-->
															</xsl:for-each>
															<!--POSTYPES-->
														</table>
													</xsl:for-each>
													<!--SETTLEDATE-->
													<BR/>
												</xsl:for-each>
												<!--SETTLE-->
											</xsl:for-each>
											<!--FIRM-->
										</xsl:when>
										<xsl:otherwise>
											<xsl:for-each select="FIRM">
												<xsl:for-each select="SETTLE">
													<xsl:for-each select="SETTLEDATE">
														<xsl:for-each select="POSTYPES">
															<xsl:for-each select="GROUP">
																<table width="1000" style="background=#FFFAF0; color=#191970; font-size:11; word-wrap:break-word; border:0; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0;" border="1">
																	<tr>
																		<td colspan="2" style="background= #B0C4DE; color=#191970">
																			<xsl:text>Trading Member:</xsl:text>
																		</td>
																		<td width="5%">
																			<xsl:for-each select="../../../../@FirmID">
																				<xsl:value-of select="string(.)"/>
																			</xsl:for-each>
																		</td>
																		<td style="background= #B0C4DE; color=#191970">
																			<xsl:text>TCA Code:</xsl:text>
																		</td>
																		<td colspan="2">
																			<xsl:for-each select="../../../@ClrAccCode">
																				<xsl:value-of select="string(.) "/>
																			</xsl:for-each>
																		</td>
																		<td style="background= #B0C4DE; color=#191970">
																			<xsl:text>Settlement date:</xsl:text>
																		</td>
																		<td>
																			<xsl:for-each select="../../@SettleDate">
																				<xsl:variable name="seqContentStrings_2">
																					<xsl:value-of select="format-number(number(substring(string(string(.)), 9, 2)), '00')"/>
																					<xsl:text>-</xsl:text>
																					<xsl:value-of select="format-number(number(substring(string(string(.)), 6, 2)), '00')"/>
																					<xsl:text>-</xsl:text>
																					<xsl:value-of select="format-number(number(substring(string(string(string(.))), 1, 4)), '0000')"/>
																				</xsl:variable>
																				<xsl:variable name="sContent_2" select="string($seqContentStrings_2)"/>
																				<xsl:value-of select="$sContent_2"/>
																			</xsl:for-each>
																		</td>
																	</tr>
																	<tr>
																		<td colspan="2" style="background= #B0C4DE; color=#191970">
																			<xsl:text>Section of data on obligation types: </xsl:text>
																		</td>
																		<td colspan="4">
																			<xsl:choose>
																				<xsl:when test="../@PosType = 'C'">
																					<span>
																						<xsl:text>- information on net obligations/requirements for a cash position</xsl:text>
																					</span>
																				</xsl:when>
																				<xsl:when test="../@PosType = 'S'">
																					<span>
																						<xsl:text>- information on net obligations/claims for depository sections </xsl:text>
																					</span>
																				</xsl:when>
																			</xsl:choose>
																		</td>
																		<xsl:choose>
																			<xsl:when test="../@PosType = 'C'">
																				<td style="background= #B0C4DE; color=#191970">
																					<xsl:text>Cash Register code: </xsl:text>
																				</td>
																				<td>
																					<xsl:for-each select="@BankAccCode">
																						<xsl:value-of select="string(.) "/>
																					</xsl:for-each>
																				</td>
																			</xsl:when>
																		</xsl:choose>
																		<xsl:choose>
																			<xsl:when test="../@PosType = 'S'">
																				<td style="background= #B0C4DE; color=#191970">
																					<xsl:text>Custody (sub-account) account for securities record: </xsl:text>
																				</td>
																				<td>
																					<xsl:for-each select="@GuarDepUnitId">
																						<xsl:value-of select="string(.) "/>
																					</xsl:for-each>
																				</td>
																			</xsl:when>
																		</xsl:choose>
																	</tr>
																</table>
																<table width="1000" style="background=#FFFAF0; color=#191970; border:1; border-bottom:0; border-collapse:collapse; border-left:0; border-right:0; border-top:0; font-family:Arial; font-size:9; word-wrap:break-word;" border="1">
																	<thead style="text-align:center; word-wrap:break-word; ">
																		<tr style="text-align:center; vertical-align:top; word-wrap:break-word; color:#191970; background=#E6E6FA;">
																			<th>
																				<xsl:text>Obligation types</xsl:text>
																			</th>
																			<xsl:choose>
																				<xsl:when test="../@PosType = 'S'">
																					<th>
																						<xsl:text>Settlement currency ID</xsl:text>
																					</th>
																					<th>
																						<xsl:text>Settlement currency name</xsl:text>
																					</th>
																					<th>
																						<xsl:text>Security ID</xsl:text>
																					</th>
																					<th>
																						<xsl:text>Short name of the security</xsl:text>
																					</th>
																				</xsl:when>
																				<xsl:when test="../@PosType = 'C'">
																					<th>
																						<xsl:text>Currency ID</xsl:text>
																					</th>
																					<th>
																						<xsl:text>Currency Name</xsl:text>
																					</th>
																				</xsl:when>
																			</xsl:choose>
																			<th>
																				<xsl:text>Net Obligations</xsl:text>
																			</th>
																			<th>
																				<xsl:text>Net Claims</xsl:text>
																			</th>
																		</tr>
																	</thead>
																	<tbody>
																		<xsl:for-each select="RECORDS">
																			<tr style="vertical-align:top; ">
																				<td style="border-bottom:0; border-top:0; text-align:right; ">
																					<xsl:choose>
																						<xsl:when test="@DataType='TRADE'">
																							<span>
																								<xsl:text>under agreements</xsl:text>
																							</span>
																						</xsl:when>
																						<xsl:when test="@DataType='FEE'">
																							<span>
																								<xsl:text>negotiable part of the commission fee with payment on the day of agreement performance</xsl:text>
																							</span>
																						</xsl:when>
																					</xsl:choose>
																				</td>
																				<td style="border-bottom:0; border-top:0; text-align:right; ">
																					<xsl:for-each select="@CurrencyId">
																						<xsl:value-of select="string(.) "/>
																					</xsl:for-each>
																				</td>
																				<td style="border-bottom:0; border-top:0; text-align:right; ">
																					<xsl:for-each select="@CurrencyName">
																						<xsl:value-of select="string(.) "/>
																					</xsl:for-each>
																				</td>
																				<xsl:choose>
																					<xsl:when test="../../@PosType = 'S'">
																						<td style="border-bottom:0; border-top:0; text-align:right; ">
																							<xsl:for-each select="@SecurityId">
																								<xsl:value-of select="string(.) "/>
																							</xsl:for-each>
																						</td>
																						<td style="border-bottom:0; border-top:0; text-align:right; ">
																							<xsl:for-each select="@SecShortName">
																								<xsl:value-of select="string(.) "/>
																							</xsl:for-each>
																						</td>
																					</xsl:when>
																				</xsl:choose>
																				<td style="border-bottom:0; border-top:0; text-align:right; ">
																					<xsl:for-each select="@Debit">
																						<xsl:value-of select="string(.) "/>
																					</xsl:for-each>
																				</td>
																				<td style="border-bottom:0; border-top:0; text-align:right; ">
																					<xsl:for-each select="@Credit">
																						<xsl:value-of select="string(.) "/>
																					</xsl:for-each>
																				</td>
																			</tr>
																			<tr>
																				<td colspan="7" style="border-bottom:0; border-left:0; border-right:0; font:10; font-weight:bold; height:1; line-height:1; text-align:left; "/>
																			</tr>
																		</xsl:for-each>
																	</tbody>
																</table>
																<br/>
															</xsl:for-each>
														</xsl:for-each>
													</xsl:for-each>
												</xsl:for-each>
											</xsl:for-each>
										</xsl:otherwise>
									</xsl:choose>
								</xsl:for-each>
							</xsl:for-each>
						</xsl:for-each>
					</xsl:otherwise>
				</xsl:choose>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>
