<?xml version="1.0" encoding="UTF-8"?>
<!-- XSLT-шаблоны для печати, отправки на e-mail: обычный баланс на e-mail и html -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output method="html" encoding="UTF-8" indent="yes"/>

<xsl:template match="/data">
<html>

<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>

<body>
    <center>
    	<h2>Отчет по балансу<br/>Контракт:&#160;<xsl:value-of select="@contractTitle"/>(<xsl:value-of select="@comment"/>)</h2>
         Период с: <xsl:value-of select="@date1"/> по <xsl:value-of select="@date2"/><br/><br/>
     </center>
    <xsl:call-template name="main"/><br/>
</body>
</html>
</xsl:template>

<xsl:template name="main">
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
    <td><b>Месяц, год</b></td>
    <td><b>Входящий остаток</b></td>
    <td><b>Приход</b></td>
    <td><b>Наработка</b></td>
    <td><b>Расход</b></td>
    <td><b>Исходящий остаток</b></td>
</tr>
<xsl:for-each select="/data/row">
	<tr>	
		<td> <xsl:value-of select="@month"/> </td>
		<td> <xsl:value-of select="@input_balance"/> </td>
		<td> <xsl:value-of select="@payment"/> </td>
		<td> <xsl:value-of select="@account"/> </td>
		<td> <xsl:value-of select="@charge"/> </td>
		<td> <xsl:value-of select="@output_balance"/> </td>
	</tr>
</xsl:for-each>
</table>
</xsl:template>

</xsl:stylesheet>
