XML Webpart (Sharepoint 2003)
From ctowiki
| This page has not been reviewed for accuracy with SharePoint 2007, it reflects SharePoint 2003 information. |
One of the webparts that you can add to your WSU mySite, and other, pages, is the XML Webpart.
This webpart allows you to bring in a wide variety of XML and format it in your WSU mySite. An important use is to bring in RSS feeds (see WSU Wiki on RSS for more information on RSS).
How to Instructions
- Choose Modify this page
- Browse for a webpart
- In the ___ list, find XML Webpart at the bottom of the last page
- Configure three pieces of information:
- The URL of the XML
- The URL of the XSLT
- The name you want for the title of the webpart
Making an RSS reader
- Follow the steps above, supply the URL of the RSS you want
- NOTE: we really don't want to do this, we want to have a URL for the stylesheet, but I'm in a hurry. There should actually be a collection of style sheets and they should be published with the kinds of RSS they are designed to style.
- For the XSLT, use copy & paste this into the little text area (Don't supply an XSLT URL)
<?xml version="1.0" encoding="ISO-8859-1" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"> <xsl:output method="html"/> <xsl:template match="channel"> <div> <table> <div class="wsupara"> <xsl:choose> <xsl:when test="item!=''"> <xsl:for-each select="item"> <b> <a target="_blank"> <xsl:attribute name="href"> <xsl:value-of select="link"/> </xsl:attribute> <xsl:value-of select="title"/> </a></b> <br/> <xsl:value-of select="dc:creator"/> <font size="1"><xsl:if test="(slash:comments) > 0"> <a target="_new"> <xsl:attribute name="href"> <xsl:value-of select="comments"/> </xsl:attribute> <i>Comments ( <xsl:value-of select="slash:comments"/> )</i></a> </xsl:if></font> <Br/> </xsl:for-each> </xsl:when> <xsl:otherwise>This is an empty RSS feed. </xsl:otherwise> </xsl:choose> </div> </table> </div> </xsl:template> </xsl:stylesheet>
- Set the name for the webpart.





