Return to Snippet

Revision: 54725
at January 9, 2012 22:12 by stentebjerg

Initial Code
@using System.Xml.XPath;
@using System.Xml;

    //Fetch RSS XML
    XmlTextReader udBrudRSS = new XmlTextReader("");
    //Create new XML document
    XmlDocument doc = new XmlDocument();
    //Load in our remote XML into our XML document
    //Select our nodes we want with some xPath
    XmlNodeList rssItems = doc.SelectNodes("//item");
        //For each item node we can then ouput what we want
        foreach (XmlNode node in rssItems)
                <div class="date">@node["pubDate"].InnerText</div>
                <a href="@node["link"].InnerText">@node["title"].InnerText<span></span></a>

Initial URL

Initial Description
Razor snippet that fetch external RSS feed in Umbraco.

Initial Title
Razor fetch RSS XML

Initial Tags

Initial Language