RemoteRss.cshtml settings

Topics: Administration, General
Aug 11, 2014 at 8:56 AM
Edited Aug 16, 2014 at 7:49 AM
when using below setup I do NOT get any entries!

PS: with another feed containing <channel> and <item> [.Element("channel") and .Elements("item")]
all works fine!

questions:
  • what are the criterias for the tags (.element, elements)
    i.e. is <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us"> ... </feed>? correct OR MUST it be <feed>...</feed>?
I'm confused on what to enter for 'Element and Elements' in below case?
thanks for your ideas and time
ed

My RemoteRss.cshtml:

@using System.Xml.Linq
@{
    var feed = Model.Feed as XElement;
}
<ul>
    @foreach (var item in feed
            .Element("feed")
            .Elements("entry")
            .Take((int)Model.ItemsToDisplay))
    {
        <li><a href="@item.Element("link").Value">@item.Element("title").Value</a></li>
    }
</ul>

copied from 'feed' (in RemoteRss.cshtml: 'var feed = Model.Feed as XElement;'):

``` <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us">
<title>www.washingtontimes.com stories: Golf</title>
<link href="http://www.washingtontimes.com/sports/golf/?utm_medium=RSS" rel="alternate" />
<link href="http://www.washingtontimes.com/atom/headlines/sports/golf/" rel="self" />
<id>http://www.washingtontimes.com/sports/golf/?utm_medium=RSS</id>
<updated>2014-08-12T08:37:33-04:00</updated>
```etc
</entry>
</feed>