diff options
Diffstat (limited to 'static/rss.xsl')
-rw-r--r-- | static/rss.xsl | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/static/rss.xsl b/static/rss.xsl new file mode 100644 index 0000000..3bfd627 --- /dev/null +++ b/static/rss.xsl @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="utf-8"?><!DOCTYPE xsl:stylesheet [ + <!ENTITY nbsp " "> + <!ENTITY copy "©"> + <!ENTITY reg "®"> + <!ENTITY trade "™"> + <!ENTITY mdash "—"> + <!ENTITY ldquo "“"> + <!ENTITY rdquo "”"> + <!ENTITY pound "£"> + <!ENTITY yen "¥"> + <!ENTITY euro "€"> + +]> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:atom="http://www.w3.org/2005/Atom"> +<xsl:output method="xml" version="1.0" encoding="utf-8" + doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" + doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/> +<xsl:template match="/"> + <xsl:apply-templates select="rss/channel"/> +</xsl:template> + +<xsl:template match="rss/channel"> + +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> +<title><xsl:value-of select="atom:title"/></title> +<link rel="stylesheet" type="text/css" href="/css/rss.css"/> +</head> + +<body> +<h1><xsl:apply-templates select="title"/></h1> +<p>This RSS feed provides the latest posts from <xsl:apply-templates select="title"/>.</p> + +<h2>What is an RSS feed?</h2> +<p>An RSS feed is an XML-based data format that allows publishers to syndicate information. It allows you to stay up to date on topics that interest you—all in one place—without visiting 20-30 different web sites to check for new content. All you need to do to get started is to add the URL (web address) for this feed to your RSS reader.</p> +<p>The URL for this RSS feed is: <xsl:apply-templates select="atom:link"/></p> + +<xsl:apply-templates select="item"/> + +</body> +</html> + +</xsl:template> + +<xsl:template match="item"> + <h2><a href="{link}"><xsl:apply-templates select="title"/></a></h2> + <p><xsl:apply-templates select="description"/></p> + <hr/> +</xsl:template> + +<xsl:template match="title"> + <xsl:value-of select="."/> +</xsl:template> + +<xsl:template match="description"> + <xsl:value-of select="."/> +</xsl:template> + +<xsl:template match="atom:link"> + <a href="{.}"><xsl:value-of select="."/></a> +</xsl:template> + +<xsl:template match="link"> + <a href="{.}"><xsl:value-of select="."/></a> +</xsl:template> + + +</xsl:stylesheet> |