<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <xsl:template name="translateBR">
    <xsl:param name="data"/>

    <xsl:variable name="br">
      <xsl:text>&lt;br /&gt;</xsl:text>
    </xsl:variable>

    <xsl:choose>
      <xsl:when test="contains($data, $br)">
        <xsl:value-of select="substring-before($data, $br)"/>
        <br/>
        <xsl:call-template name="translateBR">
          <xsl:with-param name="data">
            <xsl:value-of select="substring-after($data, $br)"/>
          </xsl:with-param>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$data"/>
      </xsl:otherwise>
    </xsl:choose>

  </xsl:template>

  <xsl:attribute-set name="row-column-span-style">
    <xsl:attribute name="rowspan">3</xsl:attribute>
    <xsl:attribute name="colspan">3</xsl:attribute>
  </xsl:attribute-set>

  <xsl:attribute-set name="row-span-style">
    <xsl:attribute name="rowspan">3</xsl:attribute>
  </xsl:attribute-set>
    
  <xsl:template match="/">

    <xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" />
    <xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />

    <html>
      <head>
        <META http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <style type="text/css">
          table{border-collapse: collapse;}
          table td{padding: 0px; font-family: Tahoma; font-size: 12px; white-space:nowrap; border:1px solid #a7a7a7; padding:2px;}
          table tr{height: 17px;}
          table.inner td{padding: 2px 3px 2px 3px;vertical-align: top;border: 1px solid #a7a9ac;}
        </style>
      </head>
      <body>
        <p>
          <xsl:value-of select="/Document/Line1" />
        </p>
        <p>
          <xsl:value-of select="/Document/Line2" />
        </p>
        <table>
          <xsl:choose>
            <xsl:when test="/Document/WriteSignature = 'true'">
              <tr style="padding-top:20px;">
                <td style="font-size:12px;color:#626365; border:0px;">
                  Veeam Backup &amp; Replication <xsl:value-of select="/Document/Shell_App_Version" />
                </td>
              </tr>
            </xsl:when>
          </xsl:choose>
        </table>
      </body>
    </html>

  </xsl:template>

</xsl:stylesheet>
