xml - 编辑 SharePoint 2010 Rss Feed WebPart 的 XSL

标签 xml sharepoint sharepoint-2010 web-parts xslt

问候,

我不是 XSL/XSLT/XML 专家,不过我曾与一些人一起工作过,但我从未接触过 SharePoint 2010 中的 rss feed webpart xsl,并且对其工作原理知之甚少。

我想要实现的是,当 Web 部件加载提要时,我希望显示标题,包括新闻提要的日期和来源。提供了所有 3 个字段,包括描述等。

我知道 SharePoint 的 Rss Feed Web 部件为此提供了 XSL,但它没有按照我想要的方式显示。那么我要问的是如何在 Web 部件中自定义 RSS 提要的显示?

非常感谢任何可以告诉我它是如何工作的指南或类似内容。

提前致谢!

最佳答案

您可以很好地使用 RSS Web 部件:首先编辑 Web 部件并查找 XSL 编辑器按钮

Edit RSS part image 1 enter image description here

在 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/

相关文章:

android - 将 dimens.xml 中的尺寸应用于使用 Html.fromHtml 格式化的文本

java - 如何使用用户输入将另一个 XML 元素添加到预先存在的文件中?

.net - 使用SPSite构造函数的FileNotFoundException

php - Android 本地数据库通过 PHP 转换为 XML 到 mySql。

xml - XSL 仅在一个节点上排序

c# - 从列表中检索特定列的 SharePoint linq 查询

Sharepoint 提醒电子邮件

SharePoint 将网站 Logo 链接重定向到根网站集主页

visual-studio-2010 - 如何防止 VS2010 自动将新的 SharePoint 模块添加到随机功能

jquery - 共享点 2010 : Image preview on hover in New Item Form