<?xml version="1.0" encoding="windows-1251"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<!-- =========================================================================
<?xml-stylesheet type="text/xsl" href="D:\MyProgs\БД накопления метеоданных\тесты\METAR\report.xsl"?>

		шаблон для отчета анализа сводок
	========================================================================= -->
	<xsl:output method="html" encoding="windows-1251" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
	<xsl:template match="/">
		<html xmlns="http://www.w3.org/1999/xhtml">
			<head>
				<meta http-equiv="Content-Type" content="text/html; charset=windows-1251"/>
				<title>Отчет валидации файла ФК</title>
				<style type="text/css">
				.style1 {
					font-family: "Courier New", Courier, monospace;
					font-size: 12px;
				}
				.style2 {
					font-family: "Courier New", Courier, monospace;
					font-size: 12px;
					background-color:#FF0000;
					color:#FFFF00;
				}
				.style3 {
					font-weight: bold;
				}
				.style4 {
					font-family: "Courier New", Courier, monospace;
					font-size: 12px;
					color:#3300FF;
					font-weight: bold;
				}
				.style5 {
					font-family: "Courier New", Courier, monospace;
					font-size: 12px;
					background-color:#FFFFFF;
					color:#FFFFFF;
				}
				.style6 {
					font-family: "Courier New", Courier, monospace;
					font-size: 12px;
					background-color:#80FF80;
					font-weight: bold;
				}
				.style7 {
					font-family: "Courier New", Courier, monospace;
					font-size: 12px;
					background-color:#80FFFF;
					font-weight: bold;
				}
				</style>
			</head>
			<body>

				<xsl:choose>
					<xsl:when test="//lineerror">
						<xsl:if test="//header">
							<span class="style1">
								Схема:&#160;<xsl:value-of select="//header/fileschema"/>
							</span>
							<xsl:if test="//header/filedata">
								<br/>
								<span class="style1">
									Файл ФК:&#160;<xsl:value-of select="//header/filedata"/>
								</span>
							</xsl:if>
						</xsl:if>
					</xsl:when>
					<xsl:otherwise>
						<span class="style1">
							Ошибок нет
						</span>
					</xsl:otherwise>
				</xsl:choose>

				<xsl:for-each select="//lineerror">
					<!-- заголовок -->
					<h2>
						<xsl:value-of select="source"/>
					</h2>
					<!-- таблица ошибок -->
					<table width="100%" border="1">
						<tr>
							<th width="60" bgcolor="#CCCCCC" align="right">
								№&#160;
							</th>
							<th bgcolor="#CCCCCC">
								Ошибка
							</th>
						</tr>

							<tr>
								<!--
								<td rowspan="2" scope="row" bgcolor="#CCCCCC" align="right" >
-->
								<td  width="60" bgcolor="#CCCCCC" align="right">
									<xsl:for-each select="parents/parent">
										<span class="style1">
										Стр:&#160;<xsl:value-of select="lineno"/>
										</span>
										<br/>
									</xsl:for-each>
									<xsl:for-each select="linedef">
										<span class="style7">
										Стр:&#160;<xsl:value-of select="lineno"/> 
										</span>
									</xsl:for-each>
								</td>
								<td>
									<xsl:for-each select="parents/parent">
										<span class="style1">
<!--										Строка&#160;<xsl:value-of select="lineno"/>  -->
										&#160;(<xsl:value-of select="caption"/>)
										&#160;<xsl:value-of select="annotate"/>
										</span>
										<br/>
									</xsl:for-each>
									<xsl:for-each select="linedef">
										<span class="style7">
<!--										Строка&#160;<xsl:value-of select="lineno"/>  -->
										&#160;(<xsl:value-of select="caption"/>)
										&#160;&#160;<xsl:value-of select="annotate"/>
										</span>
									</xsl:for-each>
								</td>
							</tr>

						<xsl:for-each select="poserror">
							<tr>
								<!--
								<td rowspan="2" scope="row" bgcolor="#CCCCCC" align="right" >
-->
								<td width="60" bgcolor="#CCCCCC" align="right" valign="top">
									<xsl:if test="pos">
										<span class="style7">
										Стр:&#160;<xsl:value-of select="lineno"/> 
										</span>
										<br/>
										<span class="style7">
										Поз:<xsl:value-of select="pos"/>
										</span>
									</xsl:if>
								</td>
								<td>
									<!--								
								<td colspan="1" scope="row">
-->
									<xsl:if test="pos">
										<span class="style1"><xsl:value-of select="line1"/></span><span class="style2"><xsl:value-of select="line2"/></span><span class="style1"><xsl:value-of select="line3"/></span>
										<!--									
										<br/>
										<span class="style5">
											<xsl:value-of select="extra"/>
										</span>
										<span class="style4">
											<xsl:value-of select="extrb"/>
										</span>
										<span class="style5">
											<xsl:value-of select="extrc"/>
										</span>
	-->
										<hr/>
										Ошибка в позиции: <xsl:value-of select="pos"/>
										<br/>
										<xsl:value-of select="note"/>
										<br/>
										&quot;<span class="style6"><xsl:value-of select="field"/></span>&quot;=&quot;<span class="style2"><xsl:value-of select="value"/></span>&quot;
										<br/>
									</xsl:if>
									<span class="style3">
										<xsl:value-of select="text"/>
									</span>
								</td>
							</tr>
							<!--							
							<tr>
								<td>
									<xsl:value-of select="group"/>
									<br/>
									<span class="style3">
										<xsl:value-of select="text"/>
									</span>
								</td>
							</tr>
-->
						</xsl:for-each>
					</table>

				</xsl:for-each>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>
