Last active
August 19, 2021 09:23
-
-
Save aspose-com-kb/38aa9af940b42c1022078cb3c80f02e7 to your computer and use it in GitHub Desktop.
Extract Data From XBRL and iXBRL files in C#: The related step by step guide can be found here: https://kb.aspose.com/finance/net/how-to-extract-data-from-xbrl-file-in-c-sharp/
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.Collections.Generic; | |
| //Add reference to Aspose.Finance for .NET API | |
| //Use below namespaces to extract data from XBRL file | |
| using Aspose.Finance; | |
| using Aspose.Finance.Xbrl; | |
| using Aspose.Finance.Xbrl.Dom; | |
| using Aspose.Finance.Xbrl.Inline; | |
| namespace ExtractDataFromXBRLFile | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| //Set Aspose license before extracting data from XBRL file | |
| //using Aspose.Finance for .NET | |
| Aspose.Finance.License AsposeFinanceLicense = new Aspose.Finance.License(); | |
| AsposeFinanceLicense.SetLicense(@"c:\asposelicense\license.lic"); | |
| //load XBRL document | |
| InlineXbrlDocument XBRLDocument = new InlineXbrlDocument("InputXBRLDataFile.html"); | |
| //retrieve XBRL document contents | |
| NodeList childNodes = XBRLDocument.ChildNodes; | |
| Node firstChild = XBRLDocument.FirstChild; | |
| List<InlineFootnote> footNotes = XBRLDocument.Footnotes; | |
| List<InlineFact> inlineFacts = XBRLDocument.Facts; | |
| List<Context> contexts = XBRLDocument.Contexts; | |
| List<Unit> units = XBRLDocument.Units; | |
| //further use the XBRL document information | |
| foreach (InlineFact fact in inlineFacts) | |
| { | |
| Console.WriteLine("Fact: {0}", fact.Name); | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment