Created
August 30, 2020 18:59
-
-
Save amirkhan81/87764dad8ff95258ed945de6b8437d13 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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