Skip to content
John Nordberg edited this page Apr 8, 2020 · 7 revisions

Diwen.Xbrl is a .NET class library for low-level stand-alone handling of XBRL instances. It is focused on the serialization and deserialization of an object graph. Stand-alone means two things here:

  • It has references only to the framework class libraries
  • It does not load or resolve any urls or documents outside of the one being handled read or written (ie. has no knowledge of taxonomies or validations etc)

A normal use case for creating a XBRL instace would be roughly to:

  1. Create a new Instance object
  2. Add taxonomy related information such as entrypoint, namespaces for dimensions and domains, units, filing indicators etc
  3. Add Contexts and fill with explicit and typed members
  4. Add Facts that reference the contexts and units
  5. Output the Instance to file

This of course means that the software that is creating the Instance already has to have all the necessary information in the correct form with regards to the taxonomy used, or some way of translating or mapping it. For example any axis coordinates of a table based model would need to be converted to dimensional members, and so on.

In the other direction:

  1. Import an Instance from file
  2. Read information about the entry point, filing indicators, units etc
  3. Go through all contexts and translate their content into a meaningful reference in the target system
  4. Go through all the facts and link their values with the contexts in the target system

There are two additional use cases:

Comparing of two Instances for testing or other purposes can be done with simple call, and it produces a report with any differences. Comparison is ”intelligent” in such a way that it disregards superficial things like ids and ordering that can vary, and takes into account the actual references, members, values and so on. The comparison has some possible adjustments, for eaxmple to leave out optional metadata.

Generating XBRL Instance from Inline XBRL. (This is a new feature that has not been throughly tested.) It takes a XHTML file and selects or converts any relevant information and produces an Instance. That instance can then be handled further normally just like it would have read from a file. At the moment it can only handle 1->1 XHTML->XBRL, and there is very little if any error handling.

Clone this wiki locally