Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter ElevenSGML Functions (continued)

XBRLGetBaseTaxonomyType Function

Overview

The XBRLGetBaseTaxonomyType function analyzing the schema imports and attempts to determine the base taxonomy type.

Syntax/Parameters

Syntax

dword = XBRLGetBaseTaxonomyType ( handle hXM );

dword = XBRLGetBaseTaxonomyType ( string url );

Parameters

hXM

A handle to an XBRL Object.

url

A string specifying a URL to be parsed to determine the taxonomy.

Return Value

Returns a dword containing a taxonomy code or a formatted error code on failure.

Remarks

XBRLGetBaseTaxonomyType operates in two modes: one the basis of the loaded taxonomy; and, based on a URL value.

When returning the code for a loaded taxonomy, this function reviews the loaded schema names and determines the taxonomy based on a well known list of keywords. The primary taxonomy is searched first since some taxonomies incorporate US-GAAP. On this mode, the function requires the taxonomy to be loaded. An instance does not have to be loaded.

Note that this function relies on well-known taxonomies within the United States. For extended taxonomies that import well-known taxonomies, this will return the first found.

Return codes are group by taxonomy group and version. Most taxonomy versions are based on the year which is the lower 16 bits of the returned value. Taxonomy flags are as follows (note some years are marked forward but not released by the controlling agency): 

                                                                        /****************************************/
                                                                        /* ** Taxonomy Type/Codes               */
                                                                        /*    XBRLGetBaseTaxonomyType           */
                                                                        /*  * Data Structure                    */
#define XM_BT_UNKNOWN                                   0x00000000      /* Not Known                            */
#define XM_BT_FAMILY_MASK                               0x7F000000      /* Family Mask (avoid ERROR_BIT)        */
#define XM_BT_VERSION_MASK                              0x00FFF000      /* Version/Variation Mask               */
#define XM_BT_YEAR_MASK                                 0x00000FFF      /* Taxonomy Year Mask                   */
                                                                        /*  * Version                           */
#define XM_BT_VERSION_QUARTERS                          0x00800000      /* Quarter Flag                         */
#define XM_BT_VERSION_DATE                              0x00400000      /* Date Flag (mm-dd)                    */
#define XM_BT_VERSION_SUPPLEMENT                        0x00200000      /* Taxonomy Supplement                  */
                                                                        /*  o Quarters                          */
#define XM_BT_VERSION_QTR_MASK                          0x00007000      /* Quarter Mask                         */
#define XM_BT_VERSION_QTR_SHIFT                                 12      /* Shift to Normalize Quarter           */
#define XM_BT_VERSION_Q1                                0x00001000      /* Quarter 1                            */
#define XM_BT_VERSION_Q2                                0x00002000      /* Quarter 2                            */
#define XM_BT_VERSION_Q3                                0x00003000      /* Quarter 3                            */
#define XM_BT_VERSION_Q4                                0x00004000      /* Quarter 4                            */
                                                                        /*  o Date mm-dd                        */
#define XM_BT_VERSION_DD_SHIFT                                  12      /* Shift to Normalize Day               */
#define XM_BT_VERSION_DD_MASK                           0x0001F000      /* Mask for Day (1-31, 0 not used)      */
#define XM_BT_VERSION_MM_SHIFT                                  17      /* Shift to Normalize Day               */
#define XM_BT_VERSION_MM_MASK                           0x001E0000      /* Mask for Month (1-12, 0 not used)    */
                                                                        /*  * Primary entry Point Taxonomies    */
                                                                        /*  o FERC (does not allow for date)    */
#define XM_BT_FERC                                      0x06000000      /* FERC Group                           */
                                                                        /*  > Form Variation                    */
#define XM_BT_FERC_FORM_1                               0x00001000      /* Form 1 Group                         */
#define XM_BT_FERC_FORM_2                               0x00002000      /* Form 2 Group                         */
#define XM_BT_FERC_FORM_6                               0x00003000      /* Form 6 Group                         */
#define XM_BT_FERC_FORM_60                              0x00004000      /* Form 60 Group                        */
#define XM_BT_FERC_FORM_714                             0x00005000      /* Form 714 Group                       */
                                                                        /*  > Years                             */
#define XM_BT_FERC_2020                         (XM_BT_FERC |   2020)   /* FERC 2020                            */
#define XM_BT_FERC_2021                         (XM_BT_FERC |   2021)   /* FERC 2021                            */
#define XM_BT_FERC_2022                         (XM_BT_FERC |   2022)   /* FERC 2022                            */
#define XM_BT_FERC_2023                         (XM_BT_FERC |   2023)   /* FERC 2023                            */
#define XM_BT_FERC_2024                         (XM_BT_FERC |   2024)   /* FERC 2024                            */
                                                                        /*  > Combined                          */
                                                                        /*  - 2022                              */
#define XM_BT_FERC_2020_FORM_1          (XM_BT_FERC_2022 | 0x00001000)  /* Form   1 Group                       */
#define XM_BT_FERC_2020_FORM_2          (XM_BT_FERC_2022 | 0x00002000)  /* Form   2 Group                       */
#define XM_BT_FERC_2020_FORM_6          (XM_BT_FERC_2022 | 0x00003000)  /* Form   6 Group                       */
#define XM_BT_FERC_2020_FORM_60         (XM_BT_FERC_2022 | 0x00004000)  /* Form  60 Group                       */
#define XM_BT_FERC_2020_FORM_714        (XM_BT_FERC_2022 | 0x00005000)  /* Form 714 Group                       */
                                                                        /*  - 2023                              */
#define XM_BT_FERC_2021_FORM_1          (XM_BT_FERC_2023 | 0x00001000)  /* Form   1 Group                       */
#define XM_BT_FERC_2021_FORM_2          (XM_BT_FERC_2023 | 0x00002000)  /* Form   2 Group                       */
#define XM_BT_FERC_2021_FORM_6          (XM_BT_FERC_2023 | 0x00003000)  /* Form   6 Group                       */
#define XM_BT_FERC_2021_FORM_60         (XM_BT_FERC_2023 | 0x00004000)  /* Form  60 Group                       */
#define XM_BT_FERC_2021_FORM_714        (XM_BT_FERC_2023 | 0x00005000)  /* Form 714 Group                       */
                                                                        /*  o SEC                               */
                                                                        /*  > CEF                               */
#define XM_BT_CEF                                       0x02000000      /* CEF Group                            */
#define XM_BT_CEF_2021                          (XM_BT_CEF |    2021)   /* CEF 2021                             */
#define XM_BT_CEF_2022                          (XM_BT_CEF |    2022)   /* CEF 2022                             */
#define XM_BT_CEF_2023                          (XM_BT_CEF |    2023)   /* CEF 2023                             */
#define XM_BT_CEF_2024                          (XM_BT_CEF |    2024)   /* CEF 2024                             */
                                                                        /*  > ECD                               */
#define XM_BT_ECD                                       0x03000000      /* ECD Group                            */
#define XM_BT_ECD_2022                          (XM_BT_ECD |    2022)   /* ECD 2022                             */
#define XM_BT_ECD_2023                          (XM_BT_ECD |    2023)   /* ECD 2023                             */
#define XM_BT_ECD_2024                          (XM_BT_ECD |    2024)   /* ECD 2024                             */
                                                                        /*  > Risk Return                       */
#define XM_BT_RR                                        0x04000000      /* Risk Return Group                    */
#define XM_BT_RR_2006                           (XM_BT_RR |     2006)   /* Risk Return 2006                     */
#define XM_BT_RR_2008                           (XM_BT_RR |     2008)   /* Risk Return 2008                     */
#define XM_BT_RR_2010                           (XM_BT_RR |     2010)   /* Risk Return 2010                     */
#define XM_BT_RR_2012                           (XM_BT_RR |     2012)   /* Risk Return 2012                     */
#define XM_BT_RR_2018                           (XM_BT_RR |     2018)   /* Risk Return 2018                     */
#define XM_BT_RR_2021                           (XM_BT_RR |     2021)   /* Risk Return 2021                     */
#define XM_BT_RR_2022                           (XM_BT_RR |     2022)   /* Risk Return 2022                     */
#define XM_BT_RR_2023                           (XM_BT_RR |     2023)   /* Risk Return 2023                     */
#define XM_BT_RR_2024                           (XM_BT_RR |     2024)   /* Risk Return 2024                     */
                                                                        /*  > VIP                               */
#define XM_BT_VIP                                       0x05000000      /* VIP Group                            */
#define XM_BT_VIP_2022                          (XM_BT_VIP |    2022)   /* VIP 2022                             */
#define XM_BT_VIP_2023                          (XM_BT_VIP |    2023)   /* VIP 2023                             */
#define XM_BT_VIP_2024                          (XM_BT_VIP |    2024)   /* VIP 2024                             */
                                                                        /*  o IFRS                              */
#define XM_BT_IFRS                                      0x11000000      /* IFRS Group                           */
#define XM_BT_IFRS_2016                         (XM_BT_IFRS |   2016)   /* IFRS 2016                            */
#define XM_BT_IFRS_2017                         (XM_BT_IFRS |   2017)   /* IFRS 2017                            */
#define XM_BT_IFRS_2018                         (XM_BT_IFRS |   2018)   /* IFRS 2018                            */
#define XM_BT_IFRS_2019                         (XM_BT_IFRS |   2019)   /* IFRS 2019                            */
#define XM_BT_IFRS_2020                         (XM_BT_IFRS |   2020)   /* IFRS 2020                            */
#define XM_BT_IFRS_2021                         (XM_BT_IFRS |   2021)   /* IFRS 2021                            */
#define XM_BT_IFRS_2022                         (XM_BT_IFRS |   2022)   /* IFRS 2022                            */
#define XM_BT_IFRS_2023                         (XM_BT_IFRS |   2023)   /* IFRS 2023                            */
#define XM_BT_IFRS_2024                         (XM_BT_IFRS |   2024)   /* IFRS 2024                            */
                                                                        /*  o SASB (obsolete)                   */
#define XM_BT_SASB                                      0x18000000      /* SASB Group                           */
#define XM_BT_SASB_2021                         (XM_BT_SASB |   2021)   /* SASB 2021                            */
                                                                        /*  o FASB                              */
                                                                        /*  > US-GAAP                           */
#define XM_BT_UGT                                       0x21000000      /* US-GAAP Group                        */
#define XM_BT_UGT_2009                          (XM_BT_UGT |    2009)   /* US-GAAP 2009                         */
#define XM_BT_UGT_2010                          (XM_BT_UGT |    2010)   /* US-GAAP 2010                         */
#define XM_BT_UGT_2011                          (XM_BT_UGT |    2011)   /* US-GAAP 2011                         */
#define XM_BT_UGT_2012                          (XM_BT_UGT |    2012)   /* US-GAAP 2012                         */
#define XM_BT_UGT_2013                          (XM_BT_UGT |    2013)   /* US-GAAP 2013                         */
#define XM_BT_UGT_2014                          (XM_BT_UGT |    2014)   /* US-GAAP 2014                         */
#define XM_BT_UGT_2015                          (XM_BT_UGT |    2015)   /* US-GAAP 2015                         */
#define XM_BT_UGT_2016                          (XM_BT_UGT |    2016)   /* US-GAAP 2016                         */
#define XM_BT_UGT_2017                          (XM_BT_UGT |    2017)   /* US-GAAP 2017                         */
#define XM_BT_UGT_2018                          (XM_BT_UGT |    2018)   /* US-GAAP 2018                         */
#define XM_BT_UGT_2019                          (XM_BT_UGT |    2019)   /* US-GAAP 2019                         */
#define XM_BT_UGT_2020                          (XM_BT_UGT |    2020)   /* US-GAAP 2020                         */
#define XM_BT_UGT_2021                          (XM_BT_UGT |    2021)   /* US-GAAP 2021                         */
#define XM_BT_UGT_2022                          (XM_BT_UGT |    2022)   /* US-GAAP 2022                         */
#define XM_BT_UGT_2023                          (XM_BT_UGT |    2023)   /* US-GAAP 2023                         */
#define XM_BT_UGT_2024                          (XM_BT_UGT |    2024)   /* US-GAAP 2024                         */
                                                                        /*  * Supporting Taxonomies/Schema      */
                                                                        /*  o FASB Supporting                   */
                                                                        /*  > SRT                               */
#define XM_BT_SRT                                       0x31000000      /* SRT Group                            */
                                                                        /*  > SRT-Roles                         */
#define XM_BT_SRT_ROLES                                 0x32000000      /* SRT Types Group                      */
                                                                        /*  > SRT-Types                         */
#define XM_BT_SRT_TYPES                                 0x33000000      /* SRT Types Group                      */
                                                                        /*  > US-Roles                          */
#define XM_BT_US_ROLES                                  0x38000000      /* US-Roles                             */
                                                                        /*  > US-Types                          */
#define XM_BT_US_TYPES                                  0x39000000      /* US-Types                             */
                                                                        /*  o SEC Supporting                    */
                                                                        /*  > Country                           */
#define XM_BT_COUNTRY                                   0x51000000      /* Country Group                        */
                                                                        /*  > Currency                          */
#define XM_BT_CURRENCY                                  0x52000000      /* Currecy Group                        */
                                                                        /*  > DEI                               */
#define XM_BT_DEI                                       0x53000000      /* DEI Group                            */
                                                                        /*  > Exchange                          */
#define XM_BT_EXCH                                      0x54000000      /* Exchange Group                       */
                                                                        /*  > Standard Industrial Classifiation */
#define XM_BT_SIC                                       0x55000000      /* State and Province Group             */
                                                                        /*  > State and Province                */
#define XM_BT_STPR                                      0x56000000      /* State and Province Group             */
                                                                        /*  o XBRL Supporting                   */
                                                                        /*  > DTR                               */
#define XM_BT_DTR                                       0x71000000      /* DTR Group                            */
                                                                        /*  > DTR Numeric                       */
#define XM_BT_DTR_NUMERIC                               0x72000000      /* DTR Group                            */
                                                                        /*  > DTR Non Numeric                   */
#define XM_BT_DTR_NON_NUMERIC                           0x73000000      /* DTR Group                            */
                                                                        /*  > DTR Types                         */
#define XM_BT_DTR_TYPES                                 0x74000000      /* DTR Group                            */
                                                                        /*  > Link Role Reference               */
                                                                        /*  - Negated                           */
#define XM_BT_LRR_NEGATED                               0x77000000      /* LRR Group                            */
                                                                        /*  - Net                               */
#define XM_BT_LRR_NET                                   0x78000000      /* LRR Group                            */
                                                                        /*  - ESMA Arcrole                      */
#define XM_BT_LRR_ESMA                                  0x79000000      /* LRR Group                            */
                                                                        /*  - Fact Explanatory                  */
#define XM_BT_LRR_FACT_EXPL                             0x7A000000      /* LRR Group                            */

Codes can be translated to formatted strings using the XBRLTaxonomyTypeToString function.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic