<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
indent="yes"/>

<xsl:variable name="lcletters">abcdefghijklmnopqrstuvwxyz</xsl:variable>
<xsl:variable name="ucletters">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>

<xsl:template match="news">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <link href="style.css" rel="stylesheet" type="text/css"/>
  <title><xsl:value-of select="title"/></title>
</head>
<body>
  <h1><xsl:value-of select="title"/></h1>
  <p><a type="application/rss+xml" href="devnews-rss.xml"><img src="rss.png" alt="RSS feed" title="RSS feed"/>DevNews feed (RSS2)</a> / <a type="application/rss+xml" href="devnews-rss1.xml"> (RSS1)</a></p>
  <p>Archives: <a href="devnews-2006.html">2006</a></p>
  <xsl:apply-templates select="year"/>
</body>
</html>
</xsl:template>

<xsl:template match="year">
  <h2><xsl:value-of select="normalize-space(text())"/></h2>
  <xsl:apply-templates select="week"/>
</xsl:template>

<xsl:template match="week">
  <div class="item">
    <h3><a>
    <xsl:attribute name="href">#<xsl:value-of select="normalize-space(parent::year/text())"/>-<xsl:value-of select="normalize-space(text())"/></xsl:attribute>Week #<xsl:value-of select="normalize-space(text())"/></a> (<xsl:value-of select="range"/>)</h3>
    <xsl:apply-templates select="announce"/>
    <xsl:apply-templates select="source"/>
  </div>
</xsl:template>

<xsl:template match="announce">
  <em><xsl:value-of select="."/></em>
</xsl:template>

<xsl:template match="source">
  <h4><xsl:value-of select="normalize-space(text())"/></h4>
  <div class="subitem">
    <xsl:apply-templates select="item"/>
  </div>
</xsl:template>

<xsl:template match="item">
  <p><span>
  <xsl:attribute name="class">tag <xsl:value-of select="@type"/></xsl:attribute>
  [<xsl:value-of select="translate(@type,$lcletters,$ucletters)"/>]
  </span> <xsl:apply-templates/></p>
</xsl:template>

<xsl:template match="bug">
  <a>
  <xsl:attribute name="href">http://bugzilla.gnome.org/show_bug.cgi?id=<xsl:value-of select="@num"/></xsl:attribute>
  <xsl:value-of select="."/>
  </a>
</xsl:template>

<xsl:template match="attach">
  <a>
  <xsl:attribute name="href">http://bugzilla.gnome.org/attachment.cgi?id=<xsl:value-of select="@num"/>&amp;action=view</xsl:attribute>
  <xsl:value-of select="."/>
  </a>
</xsl:template>

<xsl:template match="a">
  <xsl:copy-of select="."/>
</xsl:template>

<xsl:template match="ul">
  <ul><xsl:apply-templates/></ul>
</xsl:template>

<xsl:template match="li">
  <li><xsl:apply-templates/></li>
</xsl:template>

</xsl:transform>
