<?xml version="1.0" encoding="utf-8"?>
<!--
  Title: Atom 1.0 XSL Template
  Author: Gene McCulley [based on an original from Rich Manalang (http://manalang.com)]
  Description: This should convert any valid Atom 1.0 feed to HTML.  It may be making assumptions about which elements exist.
-->
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:html="http://www.w3.org/1999/xhtml"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:atom="http://www.w3.org/2005/Atom"
  exclude-result-prefixes="atom html">
	<xsl:output method="xml" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" indent="yes" />
	<xsl:template match="/">
		<html xmlns="http://www.w3.org/1999/xhtml">
		<head>
        <style type="text/css">
	    .title {
		text-align: center;
	    }
        </style>
		<title>
			<xsl:value-of select="/atom:feed/atom:title"/>
		</title>
		<link rel='alternate' type='application/atom+xml' title='Atom (full content)' href='blog.atom' />
		<link rel="alternate" type="application/rss+xml" title="RSS" href="blog.rss" />
		</head>
		<body>
			<xsl:apply-templates select="/atom:feed"/>
			<div>
			<a href="http://www.feedvalidator.org/check.cgi?url=http://www.stackframe.com/people/mcculley/blog.atom"><img src="/images/valid-atom.png" alt="[Valid Atom 1.0]" title="Validate this Atom 1.0 feed" /></a>
			<a href="http://www.feedvalidator.org/check.cgi?url=http://www.stackframe.com/people/mcculley/blog.rss"><img src="/images/valid-rss.png" alt="[Valid RSS]" title="Validate this RSS feed" /></a>
 			<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml11" alt="Valid XHTML 1.1" height="31" width="88" /></a>
			<a href="http://jigsaw.w3.org/css-validator/"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a>
			</div>
		</body>
		</html>
	</xsl:template>
	<xsl:template match="/atom:feed">
		<h1 class="title">
			<xsl:value-of select="atom:title"/>
		</h1>
		<h2 class="title">
			<xsl:value-of select="atom:subtitle"/>
		</h2>
		<h3 class="title">
			<a href="{atom:author/atom:uri}">
				<xsl:value-of select="atom:author/atom:name"/>
			</a>
			<br/>
			<a href="mailto:{atom:author/atom:email}">
				<xsl:value-of select="atom:author/atom:email"/>
			</a>
		</h3>
		<ul>
			<xsl:apply-templates select="atom:entry"/>
		</ul>
	</xsl:template>
	<xsl:template match="atom:entry">
		<li>
    		<xsl:value-of select="atom:title"/> (<xsl:value-of select="atom:published"/>)
			<xsl:apply-templates select="atom:content"/>
		<br/>
		</li>
	</xsl:template>
	<xsl:template match="atom:content">
		<xsl:copy-of select="html:div"/>
	</xsl:template>
</xsl:stylesheet>
