home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 December
/
PCWorld_2006-12_cd.bin
/
komunikace
/
netscape
/
nsb-install-8-1-2.exe
/
chrome
/
RSSPrettyPrint2.xsl
< prev
next >
Wrap
Extensible Markup Language
|
2006-09-12
|
5KB
|
117 lines
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:atom="http://purl.org/atom/ns#"
xmlns="http://www.w3.org/1999/xhtml">
<xsl:output method="xml"/>
<!-- Main body of stylesheet -->
<xsl:template match="/atom:feed">
<mytitle id='rsstitle'>
<xsl:attribute name="label">
<xsl:value-of select="atom:head/atom:title|atom:title"/>
</xsl:attribute>
</mytitle>
<myNode anonid="rsslinklist">
<xsl:call-template name="rsslinks"/>
</myNode>
<xsl:call-template name="insert_ad"/>
<xsl:call-template name="rssitemlist"/>
</xsl:template>
<!-- this generates a list of <rsslink/> entries, one for each article in the document -->
<xsl:template name="rsslinks">
<xsl:for-each select="atom:entry">
<rsslink>
<xsl:attribute name="thislink">
<xsl:choose>
<xsl:when test="boolean(atom:link)">
<xsl:value-of select="atom:link/@href"/>
</xsl:when>
<xsl:when test="boolean(atom:head/atom:link)">
<xsl:value-of select="atom:head/atom:link/@href"/>
</xsl:when>
<xsl:when test="boolean(../atom:link)">
<xsl:value-of select="../atom:link/@href"/>
</xsl:when>
<xsl:when test="boolean(../atom:head/atom:link)">
<xsl:value-of select="../atom:head/atom:link/@href"/>
</xsl:when>
</xsl:choose>
</xsl:attribute>
</rsslink>
</xsl:for-each>
</xsl:template>
<!-- This is where the code for the ad goes -->
<xsl:template name="insert_ad">
<div class="rss-ad" style="float: right;padding-left: 10px;padding-right: 10px;">
<a HREF="http://ar.atwola.com/link/93214958/aol">
<img SRC="http://ar.atwola.com/image/93214958/aol" ALT="Click here to visit our advertiser." width="160" height="600" border="0"/>
</a>
</div>
</xsl:template>
<!-- this prints out all of the rss articles -->
<xsl:template name="rssitemlist">
<xsl:for-each select="atom:entry">
<xsl:sort select="atom:updated" order="descending"/>
<xsl:sort select="atom:title" order="ascending"/>
<xsl:sort select="atom:summary" order="ascending"/>
<div style="font-family: sans-serif;margin-left: 45px;margin-top: 4px;margin-bottom: 16px;">
<img class="readcheck" style="float: left;padding-right: 5px;margin-left: -45px;">
<xsl:attribute name="aref">
<xsl:choose>
<xsl:when test="boolean(atom:link)">
<xsl:value-of select="atom:link/@href"/>
</xsl:when>
<xsl:when test="boolean(atom:head/atom:link)">
<xsl:value-of select="atom:head/atom:link/@href"/>
</xsl:when>
<xsl:when test="boolean(../atom:link)">
<xsl:value-of select="../atom:link/@href"/>
</xsl:when>
<xsl:when test="boolean(../atom:head/atom:link)">
<xsl:value-of select="../atom:head/atom:link/@href"/>
</xsl:when>
</xsl:choose>
</xsl:attribute>
</img>
<b>
<span class="artitle" style="font-size: 14px;font-weight: bold;color: #000000;">
<xsl:value-of select="atom:title"/>
</span>
<span class="feedTitle" style="font-size: 14px;color: #7E7E7E;">
<xsl:value-of select='atom:head/atom:title'/>
</span>
</b>
<span class="updated" style="font-size: 14px; color: #7E7E7E;"><xsl:choose><xsl:when test="boolean(atom:nicedate)"><xsl:value-of select="atom:nicedate"/></xsl:when><xsl:otherwise><xsl:value-of select="atom:updated"/></xsl:otherwise></xsl:choose></span>
<br/>
<span class="summary" style="display: block;margin-top: 6px;font-size: 12px;color: #7E7E7E;">
<xsl:value-of select="atom:summary"/>
</span><a class="readmore" style="display: block;margin-top: 6px;font-size: 12px;color: #1C64CA;">
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="boolean(atom:link)">
<xsl:value-of select="atom:link/@href"/>
</xsl:when>
<xsl:when test="boolean(atom:head/atom:link)">
<xsl:value-of select="atom:head/atom:link/@href"/>
</xsl:when>
<xsl:when test="boolean(../atom:link)">
<xsl:value-of select="../atom:link/@href"/>
</xsl:when>
<xsl:when test="boolean(../atom:head/atom:link)">
<xsl:value-of select="../atom:head/atom:link/@href"/>
</xsl:when>
</xsl:choose>
</xsl:attribute>Read More...</a>
</div><xsl:if test="position()!=last()"><hr/></xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>