<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:rdf="http://realPrefixRemovedForThisDemo.org#"
    xmlns:rss="http://purl.org/rss/1.0/"
    xmlns="http://www.w3.org/1999/xhtml" version="1.0" exclude-result-prefixes="rdf rss">
    <xsl:template match="/">
        <html>
            <head>
                <title>
                    <xsl:value-of select="rdf:RDF/rss:channel/rss:title"/>
                </title>
            </head>
            <body>
                <xsl:apply-templates select="rdf:RDF/rss:channel"/>
            </body>
        </html>
    </xsl:template>
    <xsl:template match="rss:channel">
        <div class="channel" id="planet">
            <xsl:apply-templates select="rss:title"/>
            <xsl:apply-templates select="rss:description"/>
            <xsl:apply-templates select="rss:link"/>
            <ul>
                <xsl:apply-templates select="/rdf:RDF/rss:item"/>
            </ul>
        </div>
    </xsl:template>

    <!-- deal with attributes of <channel> -->
    <xsl:template match="rss:channel/rss:title">
        <h1>
            <xsl:value-of select="."/>
        </h1>
    </xsl:template>
    <xsl:template match="rss:link">
        <a href="{.}">
            <img alt="RSS channel" src="feed-icon-24x24.png"/>
        </a>
    </xsl:template>

    <!-- deal with each <item> -->
    <xsl:template match="rss:item">
        <li>
            <div class="item">
                <xsl:apply-templates select="rss:title"/>
                <xsl:apply-templates select="rss:description"/>
            </div>
        </li>
    </xsl:template>
    <xsl:template match="rss:item/rss:title">
        <h2>
            <a href="{../rss:link}">
                <xsl:value-of select="."/>
            </a>
        </h2>
    </xsl:template>

    <!-- deal with one shared attribute -->
    <xsl:template match="rss:description">
        <p class="description">
            <xsl:value-of select="."/>
        </p>
    </xsl:template>

</xsl:stylesheet>

