<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method='xml' version='1.0' encoding='UTF-8' indent='yes'/>

<xsl:template match="/">
  <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <title>Package Information for 
<xsl:value-of select="luau-repository/program-info/fullname"/></title>
  </head>

  <body>
  <h1><xsl:value-of select="luau-repository/program-info/fullname"/></h1>
   <ul>
     <li>ID: <xsl:value-of select="luau-repository/program-info/@id"/></li>
     <li>Short Name: <xsl:value-of select="luau-repository/program-info/shortname"/></li>
     <li>Full Name: <xsl:value-of select="luau-repository/program-info/fullname"/></li>
     <li>Description: <xsl:value-of select="luau-repository/program-info/desc"/></li>
   </ul>
    <table border="1">
      <thead>
        <tr style="background:#9acd32">

          <th align="left">Version</th>
          <th align="left">Date</th>
          <th align="left">Interface</th>
          <th align="left">Short</th>
          <th align="left">Long</th>
          <th align="left">Packages</th>
        </tr>
      </thead>
      <tbody>
      <xsl:for-each select="luau-repository/software">
      <tr>
        <td><xsl:value-of select="@version"/></td>
        <td><xsl:value-of select="date"/></td>
        <td><xsl:value-of select="interface/@version"/></td>
        <td><xsl:value-of select="short"/></td>
        <td><xsl:value-of select="long"/></td>
        <td>
	  <ul>
          <xsl:for-each select="package">
            <li><xsl:variable name="pack-uri"><xsl:apply-templates/></xsl:variable>
            <xsl:variable name="md5" select="@md5"/>
            <xsl:variable name="size" select="@size"/>
            <a href="{normalize-space($pack-uri)}" title="md5: {$md5}, size: {$size}B"><xsl:value-of select="@type"/></a></li>
          </xsl:for-each>
          </ul>
        </td>
      </tr>

      </xsl:for-each>
      </tbody>
    </table>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>

