<?xml version="1.0"?>
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns="http://www.w3.org/TR/REC-html40"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:rss="http://purl.org/rss/1.0/"
  xmlns:rss20="http://nurture.nature.com/2003/03/rss20#"
  xmlns:urchin="http://nurture.nature.com/2003/03/urchin#"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:ag="http://purl.org/rss/modules/aggregation/"
>
<xsl:output method="html" indent="yes"/>
<xsl:template match="/">
	
<html>
<head>
<title>News from the Urchin aggregator</title>
<style>
<![CDATA[ 

        body,p,td,th   { font: 12px Arial,Helvetica,sans-serif }
        th             { font-weight: bold; letter-spacing: 1px }
        pre            { color: green }
        a              { font-weight: bold; color: black }
        a:hover        { color: orange }
 ]]> 
</style>
</head>

<body bgcolor="#FFFFFF">
<table width="802">
<tr>
<td colspan="2">
<h1>Urchin News</h1>
<p>
<table width="500">
<tr>
<td bgcolor="#EEEEEE" align="center">
<a><xsl:attribute name="href"><xsl:text>urchin?q=</xsl:text><xsl:value-of select="/rdf:RDF/channel/urchin:query"/><xsl:text>&amp;fmt=rss10&amp;cmd=query&amp;submit=Search</xsl:text></xsl:attribute>RSS 1.0</a>
 - 
<a><xsl:attribute name="href"><xsl:text>urchin?q=</xsl:text><xsl:value-of select="/rdf:RDF/channel/urchin:query"/><xsl:text>&amp;fmt=rss091&amp;cmd=query&amp;submit=Search</xsl:text></xsl:attribute>RSS 0.91</a>
</td>
</tr>
</table>
</p>
</td>
</tr>
<tr>
<td>
   <table width="500" border="0" cellspacing="5" cellpadding="0" bgcolor="#EEEEEE">
         
   <xsl:for-each select="/rdf:RDF/item">
   <xsl:if test="description">
   <tr>
   <td valign="top" bgcolor="#FFFFFF">
   <a><xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute><xsl:apply-templates select="title"/></a>
   <p><xsl:apply-templates select="description"/>
   <xsl:if test="dc:creator">
   <br/><xsl:apply-templates select="dc:creator"/>
   </xsl:if>
   <xsl:if test="dc:date">
   <br/><xsl:apply-templates select="dc:date"/>
   </xsl:if>
   </p>
   <p><xsl:text>Source: </xsl:text><a><xsl:attribute name="href"><xsl:value-of select="ag:sourceURL"/></xsl:attribute><xsl:apply-templates select="ag:source"/></a>
   </p>
   </td>
   </tr>
   </xsl:if>
   </xsl:for-each>
  </table>
</td>
<td width="300" bgcolor="#FFFFFF" valign="top">
   <xsl:for-each select="/rdf:RDF/item">
   <xsl:choose>
   <xsl:when test="description">
   </xsl:when>
   <xsl:otherwise>
   <table width="298" bgcolor="#EEEEEE">
   <tr>
   <td>
   <a><xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute><xsl:apply-templates select="title"/></a>
   <xsl:text> - </xsl:text><a><xsl:attribute name="href"><xsl:value-of select="ag:sourceURL"/></xsl:attribute><xsl:value-of select="ag:source"/></a><xsl:text> (</xsl:text><a><xsl:attribute name="href"><xsl:text>urchin?q=channel_id%3A='</xsl:text><xsl:value-of select="urchin:channel_id"/><xsl:text>'+current&amp;xslt=%2Fhome%2Fmartin%2Fpublic_html%2Fnews.xsl&amp;fmt=rss10&amp;cmd=query&amp;submit=Search</xsl:text></xsl:attribute><xsl:text>More from here</xsl:text></a><xsl:text>) - </xsl:text><a><xsl:attribute name="href">urchin?q=channel_id%3A='<xsl:value-of select="urchin:channel_id"/>'+<xsl:value-of select="/rdf:RDF/channel/urchin:query"/>&amp;xslt=%2Fhome%2Fmartin%2Fpublic_html%2Fnews.xsl&amp;fmt=rss10&amp;cmd=query&amp;submit=Search</xsl:attribute>Show the results from this source</a>
   <br/>
   <br/>
   </td>
   </tr>
   </table>
   </xsl:otherwise>
   </xsl:choose>
   </xsl:for-each>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>

        <xsl:template match="description">
	<span class="standfirst"><xsl:apply-templates/></span>
	</xsl:template>
	
	<xsl:template match="date">
	<xsl:apply-templates/>
	</xsl:template>

	<xsl:template match="creator">
	<i><xsl:apply-templates/></i>
	</xsl:template>			

	<xsl:template match="source">
	<xsl:apply-templates/>
	</xsl:template>		

</xsl:stylesheet>
