Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » C# » Samples » Downloads
 
Add your own
alternative version

RSS 2.0 Framework

, 19 Jan 2013 LGPL3
RSS 2.0 framework implements the RSS 2.0 specification in strongly typed classes. The framework enables you to create and consume valid RSS 2.0 feeds in your code in just a few minutes.
rssframework_bin.zip
Raccoom.Xml.dll
Raccoom.Xml.Editors.exe
DockingManagerExtender.dll
MagicLibrary.DLL
Raccoom.Windows.Forms.dll
rssframework_demo.zip
Raccoom.Bin
DockingManagerExtender.dll
MagicLibrary.DLL
nunit.framework.dll
Raccoom.Windows.Forms
Windows
Forms
Design
Raccoom.Xml
Properties
Raccoom.Xml.csproj.user
Xml
atom.xsx
Raccoom.Xml.Editors
ActionList
Actions
Design
App.ico
Raccoom.Xml.Editors.csproj.user
Windows
Forms
Raccoom.Xml.Test
Resources
rsschannel.rss
bin
rssframework_help.zip
Raccoom.Xml.chm
rssframework_src.zip
rsschannel.rss
Raccoom.Xml.csproj.user
atom.xsx
setup.zip
setup.exe
<?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, P, H1, H2, H3, H4, H5, H6, LI, TD, TH, DD, DT
	{
	font-family: Verdana, Helvetica, Arial, sans-serif;
	font-size: 10pt;
	color: black;
	}
	BODY
	{
	background-color: #ffffff;
	color: #000000;
	/*Scrollbar-face-color: #ffcc99; 
	Scrollbar-arrow-color: black;*/
	}
	H3
	{	
	font-size: 11pt;
	}
	a:link    { text-decoration:none;      }
	a:visited { text-decoration:none;      }
	a:active  { text-decoration:underline; }
	a:hover   { 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>
	<h3><a href="{$link}" title="{$description}"><xsl:value-of select="title" /></a></h3>
	<hr/>
	<ul><xsl:apply-templates select="item"/></ul>
</xsl:template>

<xsl:template match="item">
	<xsl:variable name="item_link" select="link"/>
	<xsl:variable name="item_title" select="description"/>
	<li><a href="{$item_link}" title="{$item_title}"><xsl:value-of select="title"/></a></li>
</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.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)

Share

About the Author

Chris Richner
Software Developer (Senior) Zeit AG
Switzerland Switzerland
Biography
  • 1996 - 1998 PC Board PPL, HTML, DHTML, Javascript and ASP
  • 1999 - 2001 coding Centura against Sql Database (SqlBase,MSSQL,Oracle)
  • 2002 - 2004 C# Windows Forms
  • 2005 - 2006 C# ASP.NET, Windows Forms
  • 2006 - 2009 C#, WCF, WF, WPF
  • 2010 - 2012 C#, Dynamics CRM, Sharepoint, Silverlight
  • 2013 - now C#, WCF DS (OData), WF, WPF
Interests
  • family & friends
  • chilaxing ,)
  • coding
Follow on   Twitter   Google+   LinkedIn

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.1411022.1 | Last Updated 20 Jan 2013
Article Copyright 2003 by Chris Richner
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid