<!-- 
     Convert Europeana XML SPARQL query results to HTML with audioURL values as hypertext links. No warranty expressed or implied.
-->
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:s="http://www.w3.org/2005/sparql-results#"
                exclude-result-prefixes="s">

  <xsl:template match="s:sparql">
    <html>
      <xsl:apply-templates/>
    </html>
  </xsl:template>

  <xsl:template match="s:head">
    <head><title>Europeana Audio</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="http://www.snee.com/css/doc.css" type="text/css" rel="stylesheet" />
    </head>
  </xsl:template>

  <xsl:template match="s:results">
    <table>
      <tr><td><b>title</b></td><td><b>creator</b></td><td><b>source</b></td></tr>
      <xsl:apply-templates/>
    </table>
  </xsl:template>

  <xsl:template match="s:result">
    <tr>
      <td><a href="{s:binding[@name='mediaURL']/s:uri}"><xsl:value-of select="s:binding[@name='title']"/></a></td>
      <td><xsl:value-of select="s:binding[@name='creator']"/></td>
      <td><xsl:value-of select="s:binding[@name='source']"/></td>
    </tr>
  </xsl:template>
</xsl:stylesheet>
