<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html"/>
  
  <xsl:template match="/messages">
    <table width="100%" class="table table-striped">
      <tr style="background-color:#00aabb;" height="20px">
        <td style="width:20%">Người gửi</td>
        <td style="width:60%">Tiêu đề</td>
        <td style="width:20%">Thời gian</td>
      </tr>  
      <xsl:apply-templates select="msg"></xsl:apply-templates>
    </table>
  </xsl:template>

  <xsl:template match="msg">
    <tr>
      <td>
        <b>
          <xsl:value-of select="FromUser"/>
        </b>
      </td>
      <td >
        <a>
          <xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
          <xsl:if test="Viewed='false'">
            <b><xsl:value-of select="Title" /><img src="/images/label_new_red.png" ></img>
          </b>
          </xsl:if>
          <xsl:if test="Viewed='true'">  
            <xsl:value-of select="Title"/>
          </xsl:if>
        </a>
      </td>
      <td>
        <xsl:value-of select="SendDate"/>
      </td>
    </tr>
  </xsl:template>
</xsl:stylesheet> 

