Read XBRL and iXBRL files in C#

Read XBRL instance file in C#

Aspose.Finance supports reading XBRL documents. For this, you can use the XbrlDocument class by passing the name of a valid XBRL instance file as a parameter.

The following C# code snippet demonstrates reading an XBRL instance document.

XbrlDocument document = new XbrlDocument(XbrlFilePath + @"IdScopeContextPeriodStartAfterEnd.xml");
XbrlInstanceCollection xbrlInstances = document.XbrlInstances;
XbrlInstance xbrlInstance = xbrlInstances[0];
List<Fact> facts = xbrlInstance.Facts;
SchemaRefCollection schemaRefs = xbrlInstance.SchemaRefs;
List<Context> contexts = xbrlInstance.Contexts;
List<Unit> units = xbrlInstance.Units;

Read iXBRL file in C#

Aspose.Finance supports reading iXBRL instance documents. For this, the API provides the InlineXbrlDocument class. The constructor of the InlineXbrlDocument class accepts the name of a valid iXBRL file.

The following C# code snippet demonstrates reading an iXBRL instance document.

InlineXbrlDocument document = new InlineXbrlDocument(XbrlFilePath + @"account_1.html");
List<InlineFact> inlineFacts = document.Facts;
List<Context> contexts = document.Contexts;
List<Unit> units = document.Units;