2009-08-14 58 views
1

這是我第一次使用RSS,但我對XML/XSL流利。我有一個RSS Feed,我從Sharepoint的列表中提取。示例XML如下。
RSS描述元素自動解析Sharepoint列表中的各個列(Body,Expires,Attachments)。我知道從列表中我可以控制哪些字段包含在描述中,但這不是我所期望的。作爲元素的Sharepoint RSS提要描述字段

有什麼辦法強制字段來通過XML元素格式,而不是轉換爲HTML的CDATA?例如,我可能想要檢查一個優先級字段,如果它在應用XSL時很重要,我會大膽地將它變成紅色。由於這是HTML/CDATA格式,因此解析該字段很麻煩。

<rss version="2.0"> 
    <channel> 
    <title>Announcements</title> 
    <link>http://somewebsite/Announcements/Current.aspx</link> 
    <description>RSS feed for the Announcements list.</description> 
    <lastBuildDate>Thu, 13 Aug 2009 17:31:01 GMT</lastBuildDate> 
    <generator>Windows SharePoint Services V3 RSS Generator</generator> 
    <ttl>1</ttl> 
    <image> 
     <title>Announcements</title> 
     <url>/_layouts/images/homepage.gif</url> 
     <link>http://somewebsite/Announcements/Current.aspx</link> 
    </image> 
    <item> 
     <title>Woohoo a post! </title> 
     <link>http://somewebsite/Announcements/DispForm.aspx?ID=36</link> 
     <description> 
     <![CDATA[<div><b>Body:</b> <div> 
<div>The attached email was sent from chairman and CEO on Tuesday March 3, 2009.</div> 
<div></div></div></div> 
<div><b>Expires:</b> 7/30/2009</div> 
<div><b>Attachments:</b> <a href="http://somewebsite/Woohoo.htm">http://somewebsite/Woohoo.htm</a><br><a href=""></a></div> 
]]> 
     </description> 
     <author>Me, Myself and I</author> 
     <pubDate>Thu, 16 Jul 2009 18:38:32 GMT</pubDate> 
     <guid isPermaLink="true">http://somewebsite/Announcements/DispForm.aspx?ID=69</guid> 
    </item> 
    </channel> 
</rss> 
+0

哇,沒有想法?真? – Jay 2009-08-17 14:57:57

回答

0

還有RSSBus SharePoint Web Part。這使您可以使用模板格式化SharePoint RSS源,以便您可以獲得所需的輸出。這不是開源或免費的,但有一個可以幫助你的試用版。

+0

亞歷克斯,感謝您的信息,但要做到限制我必須使用原生的Web部件。我注意到有些產品數據以不同於其他方式的方式列出。例如,BLOG的RSS與自定義列表的RSS不同。無論如何,我正在處理我現在所擁有的並展示醜陋的CDATA。只是不想離開這個沒有迴應的 – Jay 2009-09-14 15:38:58

+2

@Jay:通常對於SharePoint來說,基礎就在那裏,但它經常需要擴展以獲得期望的結果! – 2009-09-14 15:42:41