locked
RSS feed in XML WebPart RRS feed

  • Question

  • SharePoint services 3.0

    I have used this method in the past with dispaying RSS feed using the XML webpart and then formatting with XSL.  I can not get this feed to work http://aswathdamodaran.blogspot.com/feeds/posts/default.  I  am a very basic user when it comes to XML & XSL so I usualy copy and past the XSL from other XML webparts that I have used in the past and made some basic tweeks to get it to work but no luch with this one.  Here is the XSL that I normally use;

    <?xml version="1.0"?>

    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

    <xsl:template match="/">
    <table width="100%" border="0" cellspacing="0" cellpadding="1">
      <tr>
        <td class="tablebg"><table border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF">
            <tr>
              <td><img src="images/spcacer.gif" width="163" height="1" /></td>
            </tr>
           
     <xsl:for-each select="rss/channel/item[position() &lt;6]">
            <tr>
              <td><a href="{link}"><xsl:value-of select="title"/></a></td>
            </tr>
     </xsl:for-each>
          
          </table>
        </td>
      </tr>
    </table>
    </xsl:template>
    </xsl:stylesheet>

    Please let me if you can help me changee this code or if you have a better XSL file that yuo use that will work.

    Thank you,

    Tuesday, May 31, 2011 2:47 PM

Answers

  • Sorry to hear that didnt work for you. Try to get just the plain raw xsl and work from there.

     

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="/">
    <xmp><xsl:copy-of select="*"/></xmp>
    </xsl:template>
    </xsl:stylesheet>
    

    -tom daly
    • Marked as answer by David HM Friday, June 10, 2011 8:36 AM
    Wednesday, June 8, 2011 5:11 PM

All replies

  • this is one that i've used recently that works well

     

    <?xml version="1.0"?>

    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

     <xsl:template match="/">
       

     <xsl:for-each select="rss/channel/item">

      <xsl:if test="position() &lt; 5">
    <div class='rss-item'>
     <div class='rss-title'>
     <a target='_blank'>
      <xsl:attribute name='href' ><xsl:value-of select="link"/></xsl:attribute>
     <xsl:value-of select="title"/>
     </a>
     </div>

     <div class='rss-body'><xsl:value-of select="description"/></div>

    </div>
    </xsl:if>

    </xsl:for-each>


    </xsl:template>

    </xsl:stylesheet>

     

     


    -tom daly
    • Marked as answer by Peng Lei Tuesday, June 7, 2011 8:13 AM
    • Unmarked as answer by Phillip6653 Tuesday, June 7, 2011 2:38 PM
    Friday, June 3, 2011 4:26 AM
  • Thank you for your help but this did not work for the example RSS feed that I provided.  I don't get an error but no information is displayed in the webpart.
    Tuesday, June 7, 2011 2:39 PM
  • Hi,

    Carry out the same steps by enabling verbose mode of logging so that maximum details about the isuue will becaptured.

    Thanks,

    Rahul Rashu

    Tuesday, June 7, 2011 8:07 PM
  • not sure what you what you are refering to.  Their is not a error just display's nothing.

     

    If you use the same rss feed do you get data?

    Tuesday, June 7, 2011 8:09 PM
  • Sorry to hear that didnt work for you. Try to get just the plain raw xsl and work from there.

     

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="/">
    <xmp><xsl:copy-of select="*"/></xmp>
    </xsl:template>
    </xsl:stylesheet>
    

    -tom daly
    • Marked as answer by David HM Friday, June 10, 2011 8:36 AM
    Wednesday, June 8, 2011 5:11 PM
  • Thank you for the information I can get the raw xsl to work but I just don't have the knowledge to take it from there.

     

     

    Friday, June 10, 2011 11:22 AM