<?xml version="1.0" encoding="utf-8"?>

<!-- public2html.xsl
  - style sheet to generate an RSS feed on the W3C site from XML source
  - Author: Max Froumentin (W3C) mf@w3.org
  - Copyright (c) 2001 W3C
  -->


<xsl:stylesheet 
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns="http://purl.org/rss/1.0/"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="1.0">

<xsl:output indent="yes"/>

<xsl:variable name="baseURI" select="/publicPage/@location"/>
<!-- FIXME: not XSLT 1.0 -->

<xsl:template match="/">
  <xsl:processing-instruction name="xml-stylesheet">href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"</xsl:processing-instruction>
  <rdf:RDF>
    <channel rdf:about="http://www.w3.org/Style/XSL/Overview.rss">
      <title><xsl:value-of select="publicPage/title"/></title>
      <link><xsl:value-of select="publicPage/@location"/></link>
      <description><xsl:value-of select="publicPage/shortdesc"/></description>

      <!-- table of contents: for each news item get the first <a> -->

      <items>
        <rdf:Seq>
          <xsl:for-each select="publicPage/news/item[position()&lt;11]">
            <rdf:li rdf:resource="{concat($baseURI,'/Overview.html#',concat('news-',@date,'-',translate(@title,' ()/+','_----')))}"/>
          </xsl:for-each>
	</rdf:Seq>
      </items>
    </channel>
    <xsl:for-each select="publicPage/news/item[position() &lt; 11]">
      <item rdf:about="{concat($baseURI,'/Overview.html#',concat('news-',@date,'-',translate(@title,' ()/+','_----')))}">
        <title><xsl:value-of select="@title"/></title>
	<dc:date><xsl:value-of select="@date"/></dc:date>

	  <!-- first link in news item text is a good guess: -->
<!--          <link><xsl:value-of select="a[1]/@href"/></link> -->

<!-- linking to the page is better -->
<link><xsl:value-of select="concat($baseURI,'/Overview.html#',generate-id())"/></link>
        <description><xsl:value-of select="normalize-space(.)"/></description>
      </item>
    </xsl:for-each>
  </rdf:RDF>
</xsl:template>
</xsl:stylesheet>
