Click here to Skip to main content
15,884,298 members
Articles / Web Development / ASP.NET

RSS 2.0 Framework

Rate me:
Please Sign up or sign in to vote.
4.92/5 (67 votes)
19 Jan 2013LGPL37 min read 507.1K   15.2K   361  
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.
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method = "html" version = "4.0" encoding="ISO-8859-1" indent = "no" />
<xsl:strip-space elements = "*" />

<xsl:variable name="markerNormal">&#9658;</xsl:variable>
<xsl:variable name="markerComment">&#8810;</xsl:variable>
<xsl:variable name="markerLink">&#9788;</xsl:variable>
<xsl:template match = "/opml" >
<html>
  <head><title><xsl:value-of select="head/title" /></title></head>
  <body>
    <div id="outlineRoot" class="outlineRoot">
        <xsl:for-each select="head/*" >
        <span class="outlineAttribute" title="{name()}"><xsl:value-of select="." /></span>
        </xsl:for-each>
  	<xsl:apply-templates select="body"/>
    </div>
    <span id="markerNormal" style="display:none"><xsl:value-of select="$markerNormal" /></span>
    <span id="markerComment" style="display:none"><xsl:value-of select="$markerComment" /></span>
    <span id="markerLink" style="display:none"><xsl:value-of select="$markerLink" /></span>
  </body>
</html>
</xsl:template>

<xsl:template match = "outline" >
  <div class="outline">
       <xsl:attribute name="style">
         <xsl:if test="parent::outline">display:none</xsl:if>       
       </xsl:attribute>
       <xsl:for-each select="@*[name() !='text']" >
       <span class="outlineAttribute" title="{name()}"><xsl:value-of select="." /></span>
       </xsl:for-each>
       <span>
            <xsl:attribute name="class">
              <xsl:choose>
                <xsl:when test="./*">markerClosed</xsl:when>
                <xsl:when test="contains(@url,'.opml') or contains(@url,'.OPML')">markerClosed</xsl:when>
                <xsl:otherwise>markerOpen</xsl:otherwise>
              </xsl:choose>
            </xsl:attribute>
            <xsl:choose>
            	<xsl:when test="@isComment = 'true'"><xsl:value-of select="$markerComment" /></xsl:when>
            	<xsl:when test="@type = 'link' and not(contains(@url,'.opml') or contains(@url,'.OPML'))"><xsl:value-of select="$markerLink" /></xsl:when>
            	<xsl:otherwise><xsl:value-of select="$markerNormal" /></xsl:otherwise>
            </xsl:choose>
       </span>
       <span class="outlineText">
       <xsl:value-of select = "@text" disable-output-escaping = "yes" /></span>
       <xsl:apply-templates />
  </div>
</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)


Written By
Software Developer (Senior)
Switzerland Switzerland
My interest is in the future because I am going to spend the rest of my life there. (Charles Kettering)

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 - 2013 C#, WCF DS (OData), WF, WPF
  • 2014 - 2016 C#, Azure PaaS, Identity, OWIN, OData, Web Api
  • 2017 - now C#, aspnet.core, IdentityServer4, TypeScript & Angular @ Azure IaaS or PaaS

Interests

  • family & friends
  • chilaxing ,)
  • coding

Comments and Discussions