I'm trying to write an RSS feed for the Ferrari site, but I can't read it all, using SyndicationItem. The problem is that the method getContent() reads only <link>,<title> and <description> elements (all of them are children of <item>). I need to read also the content of the <textnews> element, child of <item>. I must modify this query:
feed.LoadFromXml(feedXML);
// Query LINQ per effettuare il mapping
return feed.Items.ToList().Select(x =>
new FeedItem
{
Title = x.Title.ExtractText(),
Uri = x.GetUri(),
Id = (x.ItemUri != null) ? x.ItemUri.ToString() : x.Title.ExtractText(),
PubDate = x.PublishedDate.ToLocalTime().DateTime,
Content = x.GetContent(),
PlainTextContent = x.GetContent().ToPlainText(),
Subtitle = string.Empty,
ContentType = x.GetContentType(),
}).ToList();
Can you help me?
You'd need to parse the document as an XDocument, then parse each node. Eg: