Skip to content

Instantly share code, notes, and snippets.

@amirkhan81
Created August 30, 2020 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amirkhan81/87764dad8ff95258ed945de6b8437d13 to your computer and use it in GitHub Desktop.
Save amirkhan81/87764dad8ff95258ed945de6b8437d13 to your computer and use it in GitHub Desktop.
@using System;
@using System.IO;
@using System.Xml.XPath;
@using System.Xml;
@using umbraco.MacroEngines;
@using System.Text.RegularExpressions
@using StraylightDk
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
//Fetch RSS XML
XmlTextReader IRFeed = new XmlTextReader("url to feed");
//Create new XML document
XmlDocument doc = new XmlDocument();
//Load in our remote XML into our XML document
doc.Load(IRFeed);
// Paginate
XmlNodeList pagination = doc.SelectNodes("//Resultlist");
//Filing Nodes
XmlNodeList secFilings = doc.SelectNodes("//RESULT");
}
@{
foreach (XmlNode paginationNode in pagination) {
var countNodes = @paginationNode.Attributes["total"].Value.AsInt();
int totalNodes = @countNodes;
int pageSize = 20;
<p>@totalNodes</p>
}
//For each item node we can then ouput what we want
foreach (XmlNode node in secFilings)
{
var filingData = node.SelectNodes("FILINGDATA");
foreach (XmlNode filingInfo in filingData) {
<h3>Filing ID - @filingInfo["FILING_ID"].InnerText</h3>
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment