Get a specific number of results from an XmlDocument XPath query
问题 I'm querying a Twitter RSS feed and supplying the results into a Repeater for display. I'd like to only get the first 5 results of the XPath query. Is there a way to do that in the XPath syntax or do I have to loop over the resulting XmlNodeList to pull out the first 5? XmlDocument doc = new XmlDocument(); XmlTextReader reader = new XmlTextReader(rssPath); doc.Load(reader); XmlNodeList items = doc.SelectNodes("/rss/channel/item"); rptTwitter.ItemDataBound += new RepeaterItemEventHandler