Skip to content
January 8, 2010 / red1s

RSS Feeds in SharePoint 2010 – Using an XML webpart.


Recently I had to post an RSS Feed into a SharePoint 2010 site however wasn’t able to access the admin console.

The following method was used to edit the an XML web part to draw an RSS Feed out of any site delivering RSS Feeds – pretty useful as well just for displaying standard RSS Feed info

  1. Add a XML Web part to your page

clip_image001

  1. In Foundation this can be found under the Miscellaneous category of the webpart menu:

clip_image002

  1. Once added open up the webpart menu

clip_image003

  1. We’ll only need to place the XML link to the RSS Feed in our XML link area

clip_image004

  1. Open up the XSL Editor by hitting the XSL Editor button:

clip_image005

  1. Place the following XSL markup into the window – which will format the items into a list

 

<?xml version=”1.0″ encoding=”UTF-8″?>

<xsl:stylesheet version=”1.0″

xmlns:xsl=”http://www.w3.org/1999/XSL/Transform&#8221;

exclude-result-prefixes=”xsl”>

<xsl:output method=”xml” omit-xml-declaration=”yes” indent=”yes”/>

<xsl:template match=”/”>

<div>

<xsl:apply-templates select=”rss/channel”/>

</div>

</xsl:template>

<xsl:template match=”rss/channel”>

<xsl:variable name=”link” select=”link”/>

<xsl:variable name=”description” select=”description”/>

<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:stylesheet>

  1. Once done hit ‘OK’ and your output should be as follows:

clip_image006

  1. Name your webpart as required

clip_image007

And you’re good to go!

Just as a end note, by modifying the XSL you are able to then add images , modify the text style etc.

Digg This
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: