簡體   English   中英

重新排序Rss20FeedFormatter序列化中的元素

[英]Reordering elements in Rss20FeedFormatter serialisation

我想知道是否有一種簡單的方法可以對RSS項中的元素進行重新排序。 我想我可以手動序列化它,但是只是想知道是否有更簡單的東西。

.NET將事物序列化為

<item>
<link>http://mmu.ac.uk/library.aspx</link>
<title>URGENT Library information: borrowing facilities withdrawn</title>
<description/>
</item>

我正在使用JQuery新聞行情收錄器,期望它以不同的順序

<item>
<title>URGENT Library information: borrowing facilities withdrawn</title>
<description/>
<link>http://mmu.ac.uk/library.aspx</link>
</item>

謝謝,亞歷克斯

您可以在派生的“ MyRss20FeedFormatter”類中重寫WriteItem方法,並更改將syndicationItems數據寫入輸出流的順序。

http://msdn.microsoft.com/zh-CN/library/system.servicemodel.syndication.rss20feedformatter.writeitem.aspx

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM