<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Id$ -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="html" encoding="ISO-8859-1"/>

  <xsl:template match="mirrors">
    <table>
      <tr>
        <th>name</th>
        <th>type</th>
        <th>location</th>
        <th colspan="3">access</th>
        <th>sponsor</th>
      </tr>
      <xsl:apply-templates>
        <xsl:sort select="type"/>
        <xsl:sort select="location"/>
      </xsl:apply-templates>
    </table>
  </xsl:template>

  <xsl:template match="mirror">
    <xsl:variable name="color">
      <xsl:choose>
        <xsl:when test="position() mod 2 = 0">#FFFFFF</xsl:when>
        <xsl:otherwise>#FFDC7B</xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <tr style="background-color: {$color}">
      <td><xsl:value-of select="name"/></td>
      <td><xsl:value-of select="type"/></td>
      <td><xsl:value-of select="location"/></td>
      <td>
        <xsl:if test="http"><a href="{http}">http</a></xsl:if>
      </td>
      <td>
        <xsl:if test="ftp"><a href="{ftp}">ftp</a></xsl:if>
      </td>
      <td>
        <xsl:if test="rsync"><a href="{rsync}">rsync</a></xsl:if>
      </td>
      <td>
        <xsl:if test="sponsor">
          <a href="{sponsor/url}"><xsl:value-of select="sponsor/name"/></a>
        </xsl:if>
      </td>
    </tr>
  </xsl:template>


</xsl:stylesheet>

