<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:transform version = '1.0'
  xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
  xmlns="http://www.w3.org/1999/xhtml">

<xsl:template match="/">
  <html>
    <head>
      <title>Archive</title>
      <link rel="stylesheet" type="text/css" href="music.css"/>
    </head>
    <body>
      <xsl:apply-templates/>
    </body>
  </html>
</xsl:template>

<xsl:template match="album">
  <h2><xsl:value-of select="title"/></h2>
  <h3>(<xsl:value-of select="artist"/>/<xsl:value-of select="date"/>)</h3>
  <table border="0" cellpadding="3" cellspacing="2">
    <tr>
      <th>#</th>
      <th>Title</th>
      <th class="ar">Time</th>
    </tr>
    <xsl:for-each select="track">
      <tr>
        <td> <xsl:number level="single" count="track" format="1."/> </td>
        <td> <xsl:value-of select="."/> </td>
        <td class="ar">
          <xsl:call-template name="convert">
            <xsl:with-param name="sec" select="number(@seconds)" />
          </xsl:call-template>
        </td>
      </tr>
    </xsl:for-each>
  </table>
</xsl:template>

<xsl:template name="convert">
  <xsl:param name="sec"/>
  <xsl:value-of select="floor( $sec div 60 )"/>:<xsl:value-of
    select="format-number( $sec mod 60, '00' )"/>
</xsl:template>

</xsl:transform>
