I need help getting the first five nodes from feedSource
XmlDocument feedSource = FeedSource;
if (feedSource != null)
{
Rss.DataSource = feedSource.SelectNodes("//item")
Rss.DataBind();
}
I've seen in other examples that i should be able to use
Rss.DataSource = feedSource.SelectNodes("//item")[position() <= 5]
Rss.DataBind();
but that doesn't work. Any help would be appreciated.
Try this
Rss.DataSource = feedSource.SelectNodes("//item[position() <= 5]");
That []
part belongs to the XPath query, not to the C# part.