MOSS RSS Xslt
效果图:
MOSS 在企业EP 开发过程中,使用RSS 非常平凡
上面的效果图,在MOSS中使用2个webpart(内容编辑webpart+RSS WebPart)
内容编辑webpart 我们就不介绍。非常easy
RSS webpart 只需要在工具栏面板配置RSS Link
如:http://10.5.16.16/acd/efg/abcdeff/rss_ldjh.jsp 一个标准的rss源
RSS 样式如下:
需要有一定的xsl的基础就可以
如图
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema"
version="1.0" exclude-result-prefixes="xsl ddwrt msxsl rssaggwrt"
xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
xmlns:rssaggwrt="http://schemas.microsoft.com/WebParts/v3/rssagg/runtime"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:rssFeed="urn:schemas-microsoft-com:sharepoint:RSSAggregatorWebPart"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rss1="http://purl.org/rss/1.0/" xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:atom2="http://purl.org/atom/ns#" xmlns:ddwrt2="urn:frontpage:internal">
<xsl:template match="/" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:rssFeed="urn:schemas-microsoft-com:sharepoint:RSSAggregatorWebPart" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rss1="http://purl.org/rss/1.0/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:atom2="http://purl.org/atom/ns#">
<xsl:for-each select="rss/channel/item">
<xsl:if test="position()<5" >
<table style="width: 95%" border="0" cellpadding="2" cellspacing="1" >
<tr align="left">
<td><img src="_layouts/2052/images/SinoLube/zuo-biao.gif"/></td>
<td style="width:90%"><a href='{link}' target="_blank" title='{title}'><nobr><xsl:value-of select="substring(title,1,12)"/></nobr></a>
</td></tr>
</table>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
确实很简单
标准
version="1.0" exclude-result-prefixes="xsl ddwrt msxsl rssaggwrt"
xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
xmlns:rssaggwrt="http://schemas.microsoft.com/WebParts/v3/rssagg/runtime"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:rssFeed="urn:schemas-microsoft-com:sharepoint:RSSAggregatorWebPart"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rss1="http://purl.org/rss/1.0/" xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:atom2="http://purl.org/atom/ns#" xmlns:ddwrt2="urn:frontpage:internal">
<xsl:template match="/" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:rssFeed="urn:schemas-microsoft-com:sharepoint:RSSAggregatorWebPart" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rss1="http://purl.org/rss/1.0/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:atom2="http://purl.org/atom/ns#">
<xsl:for-each select="rss/channel">
<div style="border-bottom:solid #000033 1px; font-size:14px; height:22px; line-height:22px"> <a href="{link}" target="_blank" title="{description}"><b><xsl:value-of select="title"/></b></a> </div>
</xsl:for-each>
<xsl:for-each select="rss/channel/item">
<xsl:if test="position()<10" >
<div style="border-bottom:solid 1px #CCCCCC; padding-top:5px;text-overflow:ellipsis;overflow:hidden; width:220px"> <a href='{link}' target="_blank" title='{title}'><nobr><xsl:value-of select="title"/></nobr></a> </div>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>