Creating an XBRL program document programmatically: use a template or library?

I am working on a financial application, and one of the functions is to create an XBRL (Extensible Business Report) document. If you are familiar with XBRL instance documents, you may be aware that they usually refer to a large number of schemas. It is usually easier to create these XBRL instances using the (commecial) libraries.

Use case. Create a web form so that users fill out various fields. Create a valid instance of the XBRL using user input.
Our platform: C # and .Net

My questions:

  • Do you use any (commercial) library? Which one would you recommend for creating "annual financial statements"? Altova MapForce seems to be the dominant player.

  • An unexpected workaround to avoid using (commecial) libraries:

    • Select a valid instance document, clear all data, and save the XBRL (XML) file as a template.
    • Provide the template to the user using XSLT. Collect user input and populate XBRL using standard .Net XML libraries

Would you recommend this workaround? Why and why not?

Any input is welcome :)

+7
source share
5 answers

Now I am using a variant of the second approach. I have a template that I parse and populate with data, thanks to the standard XML library (in my case, C libxml).

The idea of ​​creating a template helps create a valid XBRL, but I think XSLT is very complex and usually limited, I prefer to use a real programming language (python in my case, but it can be C # .net)

In the foreground of commercial tools:

  • I have never used Altova.
  • Invoke is very good at displaying data in instances and very fast.

A third approach is to generate an XBRL instance only programmatically, with an XML library. XBRL is XML, after all.

+2
source

I would start with apostasy and revising the use case. Financial statements typically contain hundreds to thousands of individual numerical facts, in addition to notes and longer size notes in notes to the financial statements. Do you really want the user to sit in front of the web form and re-post this critical data?

Actually, this data exists in the database, and the safest way to get it in XBRL is the connector for this database.

As noted in the initial question, XBRL uses a large number of schemas, and the most important taxonomy schemas can contain thousands of element definitions. The user interface of standard XML tools is not optimized for this situation, but matching between internal account identifiers and basic taxonomic tags is one of the most important uses of the process. Again, consider storing this mapping in your financial database, as this is important business data.

0
source

In commercial libraries, Gepsio is the clear choice for the .NET platform and Open Source.

If the user must fill in the data, your rude decision will be correct. You can use XForms to allow the user to directly edit empty XML. Most XML databases include support for XForms.

If you are not going to use an XML database, you can use XSLTForms , an XForms plugin that works in almost any browser.

0
source

To create an xbrl file, I would use a template to avoid recompiling the solution if I don't need it. So far xslt have done a great job for me.

An xslt example for creating xbrl is as follows:

<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output omit-xml-declaration="no" /> <xsl:template match="/"> <xbrli:xbrl .... <xbrli:period> .... <xbrli:startDate><xsl:value-of select="yourcontext/contextstartdate"/></xbrli:endDate> </xbrli:period> </xbrli:xbrl> </xsl:template> </xsl:stylesheet> 

I recently created large xbrl files (size 500+ mb), and using xslt still makes a good run time. Although in order to consume these files, it is best to build an adhoc algorithm for searching and searching for what you are looking for. Using xpath makes it too slow, so it's best to create a custom algorithm to get what you need.

0
source

I am currently working on a project that consumes and generates large Xbrl documents.

For generation, we currently use Altova MapForce for map development, and Altova FlowForce and Altova MapForce Server for mapping from Xml to Xbrl. MapForce performance is not bad, but FlowForce is a little awkward when working with a large number of files.

In your use case, I would not depend on data collection, MapForce can display text files (csv) or xml. Once you have the data in the database, generate the input document (in C # like XmlDocument), and let MapForce create the output document in Xbrl.

0
source

All Articles