问候,
我不是 XSL/XSLT/XML 专家,不过我曾与一些人一起工作过,但我从未接触过 SharePoint 2010 中的 rss feed webpart xsl,并且对其工作原理知之甚少。
我想要实现的是,当 Web 部件加载提要时,我希望显示标题,包括新闻提要的日期和来源。提供了所有 3 个字段,包括描述等。
我知道 SharePoint 的 Rss Feed Web 部件为此提供了 XSL,但它没有按照我想要的方式显示。那么我要问的是如何在 Web 部件中自定义 RSS 提要的显示?
非常感谢任何可以告诉我它是如何工作的指南或类似内容。
提前致谢!
最佳答案
您可以很好地使用 RSS Web 部件:首先编辑 Web 部件并查找 XSL 编辑器按钮
在 Chrome 中不会有按钮,但这里会有一个编辑框。然后撕掉他们在那里的废话,用你自己的 xsl 替换。为了给您提供启发,我添加了这个非常简单的 xsl:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>What's going on around here</title>
</head>
<body>
<div id="explanation">
<h3>News Around here</h3>
<p>Allowing you to stay up to date with the latest news and features from here.</p>
</div>
<div id="subscribe"></div>
<div id="content">
<xsl:variable name="count" select="4"/>
<xsl:for-each select="rss/channel/item">
<xsl:variable name="myURL" select="link"/>
<div class="article" >
<a href="{$myURL}" rel="bookmark">
<xsl:value-of select="title"/>
</a>
</div>
</xsl:for-each>
</div>
</body>
</html>
关于xml - 编辑 SharePoint 2010 Rss Feed WebPart 的 XSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5857606/