|
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rss="http://purl.org/rss/1.0/"
xmlns:rss09="http://my.netscape.com/rdf/simple/0.9/"
exclude-result-prefixes="xsl rdf dc rss rss09"
>
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="/">
<html>
<head>
<style type="text/css">
body
{
font-family: Verdana, Tahoma, Sans-Serif;
font-size: 9pt;
}
/* Weblog title and byline */
#channelHeader
{
background: #99CCFF;
color: black;
margin-bottom: 1em;
}
#channelTitle
{
font-weight: bold;
font-size: 1.5em;
}
#channelDesciption
{
font-variant: normal;
font-size: 0.8em;
}
/* Entries */
div#channelContent
{
}
/* entry view */
div#item
{
border: 1px solid #3399FF;
}
div#itemTitle
{
font-weight: bold;
background: #e5f2ff;
margin-bottom: 0.5em;
}
div#itemDescription
{
margin-bottom: 1em;
}
a
{
text-decoration: none;
}
a.link
{
color: black;
text-decoration: none;
}
a:visited
{
color: black;
}
a:hover
{
text-decoration: underline;
}
#itemTitle a
{
color: black;
text-decoration: none;
}
#itemTitle a:visited
{
color: black;
text-decoration: none;
}
#itemTitle a:hover
{
color: black;
text-decoration: underline;
}
</style>
</head>
<body>
<div>
<xsl:apply-templates select="rdf:RDF/rss:channel" />
<xsl:apply-templates select="rdf:RDF/rss09:channel" />
<xsl:apply-templates select="rss/channel" />
<xsl:if test="rdf:RDF/rss:item">
<ul><xsl:apply-templates select="rdf:RDF/rss:item"/></ul>
</xsl:if>
<xsl:if test="rdf:RDF/rss09:item">
<ul><xsl:apply-templates select="rdf:RDF/rss09:item"/></ul>
</xsl:if>
</div>
</body>
</html>
</xsl:template>
<xsl:template match="rss:channel">
<xsl:variable name="link" select="rss:link"/>
<xsl:variable name="description" select="rss:description"/>
<xsl:variable name="image" select="/rdf:RDF/rss:image/rss:url"/>
<xsl:if test="$image">
<img src="{$image}" style="float: right; margin: 2px;" />
</xsl:if>
<h3><a href="{$link}" title="{$description}"><xsl:value-of select="rss:title" /></a></h3>
<hr/>
</xsl:template>
<xsl:template match="rss09:channel">
<xsl:variable name="link" select="rss09:link"/>
<xsl:variable name="description" select="rss09:description"/>
<xsl:variable name="image" select="/rdf:RDF/rss09:image/rss09:url"/>
<xsl:if test="$image">
<img src="{$image}" style="float: right; margin: 2px;" />
</xsl:if>
<h3><a href="{$link}" title="{$description}"><xsl:value-of select="rss09:title" /></a></h3>
<hr/>
</xsl:template>
<xsl:template match="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; margin: 2px;" />
</xsl:if>-->
<div id="channelHeader">
<div id="channelTitle"><a href="{$link}" title="{$description}"><xsl:value-of disable-output-escaping="yes" select="title" /></a></div>
<div id="channelDesciption"><xsl:value-of disable-output-escaping="yes" select="description"/></div>
</div>
<xsl:apply-templates select="item"/>
</xsl:template>
<xsl:template match="item">
<xsl:variable name="item_link" select="link"/>
<xsl:variable name="item_title" select="description"/>
<div id="item">
<div id="itemTitle"><a href="{$item_link}" title="{$item_title}"><xsl:value-of disable-output-escaping="yes" select="title"/></a></div>
<div id="itemDescription"><xsl:value-of disable-output-escaping="yes" select="description"/></div>
</div>
</xsl:template>
<xsl:template match="rss:item">
<xsl:variable name="item_link" select="rss:link"/>
<xsl:variable name="item_title" select="rss:description"/>
<li><a href="{$item_link}" title="{$item_title}"><xsl:value-of select="rss:title"/></a></li>
</xsl:template>
<xsl:template match="rss09:item">
<xsl:variable name="item_link" select="rss09:link"/>
<xsl:variable name="item_title" select="rss09:description"/>
<li><a href="{$item_link}" title="{$item_title}"><xsl:value-of select="rss09:title"/></a></li>
</xsl:template>
</xsl:stylesheet>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.