<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/newslist">
    <xsl:apply-templates select="news"></xsl:apply-templates>
    <xsl:apply-templates select="Category"></xsl:apply-templates>
  </xsl:template>
  
  <xsl:template match="Category">
    <div class="list-group-item" align="right">
      <a>
        <xsl:attribute name="href">
          <xsl:value-of select="CategoryUrl"/>
        </xsl:attribute>
        Xem tất cả <i class="fa fa-arrow-circle-right fa-lg"></i>
      </a>
    </div>
  </xsl:template>  
    
  <xsl:template match="news">
    <xsl:if test="position()=1">
      <div class="list-group-item">
        <div class="feature">
          <img>
            <xsl:attribute name="align">
              <xsl:value-of select="ArticleThumbnailAlign"></xsl:value-of>
            </xsl:attribute>
            <xsl:attribute name="src">
              <xsl:value-of select="NewsThumbnail"></xsl:value-of>
            </xsl:attribute>
          </img>
          <div class="title">
            <a class="title">
            <xsl:attribute name="href">
              <xsl:value-of select="link"></xsl:value-of>
            </xsl:attribute>
            <xsl:value-of select="Headline"></xsl:value-of>
          </a>
          </div>
        </div>
      </div>
 
    </xsl:if>

    <xsl:if test="position()!=1">
      <div class="list-group-item">
        <div class="internal-news-item">
          <article class="clearfix m_bottom_15 m_xs_bottom_20">
            <div class="image-container">
              <img class="media-object hidden-xs">
                <xsl:attribute name="align">
                  <xsl:value-of select="NewsThumbnailAlign"></xsl:value-of>
                </xsl:attribute>
                <xsl:attribute name="src">
                  <xsl:value-of select="NewsThumbnail"></xsl:value-of>
                </xsl:attribute>
              </img>
            </div>
            <a>
              <xsl:attribute name="href">
                <xsl:value-of select="link"/>
              </xsl:attribute>
              <xsl:value-of select="Headline"/>
            </a>
            <p class="date">
              <xsl:value-of select="CreatedDate"/>
            </p>
          </article>
        </div>
      </div>

    </xsl:if>
  </xsl:template>
  
</xsl:stylesheet>