<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://html">
  <xsl:template match="/">
    <xsl:apply-templates />
  </xsl:template>
  <xsl:template match="/EBookingRelayWebService">
    <html>
      <head>
        <title>
          <xsl:value-of select="header/title" />
        </title>
        <style>
          h1 { font-family: arial; color:#dd0000; font-size: 14pt;}
          h2 { font-family: arial; color:#dd0000; font-size: 12pt;}
          h2 { font-family: arial; color:#dd0000; font-size: 10pt;}
          td{ vertical-align: top; }
          th {

          font-family: arial;
          font-size: 10pt ;
          color: #555555;
          font-weight: bold;

          background: dddddd;
          text-align: left;

          }
          table{
          border: solid 1px #aaaaaa;
          font-size: 10pt;
          font-family: arial;
          }

          .Exception{ background: #fff0f0; }
          .Error{ background: #fff0f0; }
          .TaskStarted{ background: #f0fff0; }
          .TaskFinished{ background: #f0f0ff; }
          .StatusMessage, .DiagnosticMessage { background: #f2f2f2; }


        </style>
      </head>
      <body>
        <xsl:apply-templates select="ReportTrace" />
      </body>
    </html>
  </xsl:template>
  <xsl:template match="ReportTrace">
    <h2>Log Trace</h2>
    <table>
      <tr>
        <th>
          Time
        </th>
        <th>
          Task
        </th>
        <th>
          Message
        </th>
      </tr>
      <xsl:apply-templates select="Message" />
    </table>
  </xsl:template>
  <xsl:template match="Message">
    <tr class="{@Type}">
      <td width="100px">
        <xsl:value-of select="@When" />
      </td>
      <td width="140px">
        <xsl:value-of select="@Task" />
      </td>
      <td>
        <xsl:value-of select="Text" />
        <xsl:if test="CallStack">
          <p>
            <b>Call Stack</b>
          </p>
          <pre>
            <xsl:value-of select="CallStack" />
          </pre>
        </xsl:if>
      </td>
    </tr>
  </xsl:template>
</xsl:stylesheet>