<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    exclude-result-prefixes="xsl">
<xsl:output method="html" omit-xml-declaration="yes" indent="yes"/>

	<xsl:template match="/">
		<html xmlns="http://www.w3.org/1999/xhtml">
			<head>
				<title>
					RSS Feed for <xsl:value-of select="rss/channel/title"/>
				</title>
                                <link rel="stylesheet" href="http://marc.abramowitz.info/wp-content/themes/default/style.css" type="text/css" media="screen" />
				<style type="text/css" media="screen">
					body	 	{ background: url("http://marc.abramowitz.info/wp-content/themes/default/images/kubrickbgcolor.jpg"); }				
					#page		{ background: url("http://marc.abramowitz.info/wp-content/themes/default/images/kubrickbg.jpg") repeat-y top; border: none; } 			
					#header 	{ background: url("http://marc.abramowitz.info/wp-content/themes/default/images/kubrickheader.jpg") no-repeat bottom center; }
					#footer 	{ background: url("http://marc.abramowitz.info/wp-content/themes/default/images/kubrickfooter.jpg") no-repeat bottom; border: none;}
					#header 	{ margin: 0 !important; margin: 0 0 0 1px; padding: 1px; height: 198px; width: 758px; }
					#headerimg 	{ margin: 7px 9px 0; height: 192px; width: 740px; } 
				</style>
			</head>
            <body>
                <div id="page">
			<xsl:apply-templates select="rss/channel"/>
                </div>
            </body>
		</html>
	</xsl:template>


<xsl:template match="rss/channel">
<xsl:variable name="link" select="link"/>
<xsl:variable name="description" select="description"/>
<xsl:variable name="image" select="image/url"/>
<xsl:if test="$image">
<img src="{$image}" style="float:right" />
</xsl:if>

<div id="header">
	<div id="headerimg">
		<h1>RSS Feed for <xsl:value-of select="title" /></h1>
        </div>
</div>
<hr />

<div id="content" class="narrowcolumn"><xsl:apply-templates select="item"/></div>

<div id="sidebar">
<a href="http://feedvalidator.org/check.cgi?url=http://marc.abramowitz.info/feed/"><img src="/images/valid-rss.png" alt="[Valid RSS]" title="Validate my RSS feed" width="88" height="31" /></a>
<h3>What is this?</h3>
<p>This is a browser-friendly view of the RSS/XML formatted content feed of <b><xsl:value-of select="title" /></b>.  <a href="http://en.wikipedia.org/wiki/Really_Simple_Syndication">RSS (Really Simple Syndication)</a> is an XML-based format for distributing web content. (<a href="http://my.yahoo.com/s/rss-faq.html">More about RSS</a>)</p>
<p>RSS feeds are intended to be viewed in an RSS newsreader or on a web site like <a href="http://my.yahoo.com/">My Yahoo</a>.</p>
<p>If you use an RSS Newsreader, copy this page's web address into your news reader to subscribe to this feed.</p>
<center>
<p>
<a href="javascript:location.href='http://add.my.yahoo.com/rss?url=' + location.href">
<img src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo2.gif" border="0" align="center" alt="Add to My Yahoo!"/></a>
</p>
<p>
<a href="http://api.my.yahoo.com/rss/ping?u=http://marc.abramowitz.info/feed/">Ping My Yahoo! to refresh from my feed</a>
</p>
</center>
<h3>How did I make this look so spiffy?</h3>
<p>Short answer: An <a href="http://en.wikipedia.org/wiki/XSLT">XSLT</a> stylesheet. More details <a href="http://marc.abramowitz.info/archives/2005/05/22/using-xslt-to-create-a-nice-rendering-of-rss-feeds/">here</a>.</p>
</div>

<hr />
<div id="footer">
<p>All content Copyright msabramo. All rights reserved.</p>
</div>
</xsl:template>



<xsl:template match="item">
<xsl:variable name="item_link" select="link"/>
<div class="post">
  <h2><a href="{$item_link}"><xsl:value-of select="title"/></a></h2>
  <small><xsl:value-of select="pubDate"/></small>
  <div class="entry"><xsl:value-of select="content:encoded"/></div>
</div>
</xsl:template>

</xsl:stylesheet>
