简体   繁体   中英

SyndicationItem parses content-encoded into Summary

I am trying to parse an RSS feed item into SyndicationItem.

According to the contract, the Summary property should contain the description element from RSS 2.0. But my rss feed contains element content-encoded and the Summary of the SyndicationItem contains content-encoded instead of description. The rss feed I am using is http://www.demorgen.be/nieuws/rss.xml

//
// Summary:
//     Gets or sets a summary of the item.
//
// Returns:
//     The atom:summary element or the description element in RSS 2.0.

If content-encoded exists, what is the best way to get the text in description element?

Eventually I have to get the description from the ElementExtensions

string description;
foreach (var node in item.ElementExtensions)
{
    if (node.NodeName.Equals("summary"))
    {
        description = node .NodeValue;
        break;
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM