Build financial table from EDGAR XBRL files
If you're looking to process XBRL without re-using existing XBRL software, then the best place to start would be the XBRL Specifications. In particular, the section on XLink in XBRL will explain how XBRL Linkbases work, including the labels used in the xlink:from
and xlink:to
attributes. The short answer is that those attributes just contain arbitrary identifiers that reference the xlink:label
attribute of an element elsewhere in the file.
The specific question of how you construct financial tables from the XBRL data is tricky. An XBRL Report does not contain any explicit information that associates facts in the report with tables. You can build a list of the concepts in a section of a financial report from the presentation linkbase, but you'll often find that you have more facts than expected using those concepts. For example, if you build a list of concepts from the Balance Sheet section, you'll often find that you have facts that use those concepts but with additional dimensions because they were tagged from a note providing a breakdown of that concept.
The SEC use a heuristic-based approach to organising facts into tables. This process is documented in section 6.24 of the Edgar Filer Manual.