Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add elements, roles, links, linkbases and arcs to taxonomy extensions

...

Type & NameDescription
Processor processorA processor which is used for loading the base taxonomy.
string targetNamespaceThe target namespace of the taxonomy extension.
string targetNamespacePrefixThe XML namespace prefix for the target namespace which is used within the taxonomy extension.

string baseNamespace

The namespace of the base taxonomy.
string baseTaxonomyUriThe URI of the base taxonomy. This URI will be used for loading the base taxonomy using the passed processor.
string fileNameBaseThe name of the XSD file of the taxonomy extension.

Add Elements

New elements are added to the taxonomy extension by using the builder's AddElementToTaxonomy method. Most elements are new concepts/metrics for which values can be reported. The following parameters must be passed when creating a new element.

Type & NameDescription
string id

The ID of the element.

The ID must be unique in the whole taxonomy set, i.e. no other element defined in the extension taxonomy and no other element in the base taxonomy can have the same ID. Therefore it is recommended to add a prefix to the extension element to avoid clashes with the base taxonomy. It must be a valid ID according to the XML standard, i.e. it must be an NCName.

string nameThe name of the element.
XmlQualifiedName typeName

The type of the value which can be reported for this element.

The value is an XML qualified name which resolves to a definition of the type. Use the attributes of the class TaxonomyExtensionBuilder to use common type definitions from the XBRL specifications, e.g. MonetaryItemType.

XmlQualifiedName substitutionGroup

The substitution group of the element, which defines the type of the element.

The value is an XML qualified name which resolves to a definition of the substitution group. Use the attributes of this class to use common substitution group definitions from the XBRL specifications, e.g. ItemSubstitutionGroup can be used for adding metrics.

bool isAbstract

Defines if the extension element is abstract. It is not possible to report values for abstract elements.

Abstract elements can be used for structuring the linkbases of the taxonomy, in which elements are grouped in hierarchies. Some elements, like dimensions and hypercubes, must always be abstract.

bool isNillableDefines if xsi:nil can be reported for the extension element.
Element.ElementBalanceType balanceTypeDefines the balance type of the extension element (credit, debit or unknown).

Element.ElementPeriodType periodType

Defines the period type of the extension element, which can be instant, duration or unknown:

  • Instant is used if the element is a metric which's value is measured in a specific point in time.
  • Duration is used if the element is a metric which's value describes a development over a period of time.
  • Unknown is used if no period attribute should be added to the element, e.g. if the element is not a metric but a dimension and hence does not need a period attribute.

Add Roles

Elements are grouped in roles. A role is a group of related elements, e.g. all elements used in a single table or chapter. A role could be "Changes in Equity" or "Property, plant and equipment". To add a new role type, use the builders' AddRoleType method, which takes the following arguments:

Type & NameDescription
string idThe ID of the new role.
string definitionA string describing the role.
string filenameThe name of the taxonomy extension XSD file.
string roleUri = nullThe role's URI. If no value is passed for this attribute, the default value is used, which is a concatination of the target namespace of the taxonomy, the string "/roles/"  and the ID of the role, e.g. "http://amana.com/xbrl/roles/ID".

Add links and linkbases

Roles can have multiple links. A link contains hierarchical relationships between elements in this role. There are different types of links and a role can have multiple types of links:

  • Presentation link: Defines how elements should be displayed.
  • Calculation link: Defines of which elements an element is composed of, e.g. "Assets" is composed of "Current Assets" an "Non-current Assets".
  • Label link: Defines labels for elements. A single element can have multiple lables, e.g. different languages or different types of labels (a standard label, a terse label, a verbose label, ...).
  • Definition link: Defines hypercubes.

All links of the same type are defined within a linkbase. To create a link for a role, together with a linkbase, the method AddLinkbaseLinkWithRefs can be used, which takes the following arguments:

Type & NameDescription
XbrlRoleType roleTypeThe role for which a linkbase should be added.
XbrlLinkType linkTypeThe type of the linkbase.
BaseLinkbase linkbase = nullThe base linkbase in which the link will be added. If no value is passed, a new linkbase will be added.

Add Arcs

Links contain hierarchical relationships between elemens. A single relationship is defined by an arc. This arc defines a relationship between a from element (or parent element) and a to element (or child element). Based on the type of linkbase, a different type of arc is added to the linkbase and different attributes must be defined for the arc. To add an arc to an existing link, use the builder's AddArc method. This method takes the following arguments:

Type & NameDescription
ILInkbaseLink linkThe link to which an arc should be added.
Element fromElementThe arc's from element.
Element toElementThe arc's to element.
string arcRole

The type of relationship between the from and to element.

The value is an URI of an arcrole defined in the taxonomy. Use the constants defined in the class AMANA.XBRL.Engine.XbrlArcRoleConstants to use common arc roles defined by XBRL specifications.

decimal? order = null

The arc's order attribute which defines the order in which to elements with the same from element should be displayed/evaluated.

If there are multiple arcs with the same from element in a link, the children of the different arcs are ordered by the order. If the arc has no order, the default value 1 is assumed.

decimal weight = 1

The weight attribute must appear on calculation arcs. Calculation arcs defines which to elements sums up to a certain from element. The weight attribute defines a multiplicator which must be applied before adding it's value to the total sum (usually 1 or -1).

The XBRL specification defines constraints on valid values for the weight attribute based on the balance attribute of the from and the to element:

  • If the balance attribute of both elements is the same, the weight must not be negative.
  • If the balance attribute of both elements differ, the weight must not be positive.

If the arc is not a calculation arc, this parameter will be ignored.

bool closed = false

The closed attribute only appears on definition arcs. It can appear on arcs with the all arc role and arcs with the not all arc role for defining hypercubes:

  • If set to true, a fact's context must not contain any other dimensions beside the dimensions which are part of the hypercube to report a value for this hypercube.
  • If set to false, a fact's context can contain also other dimensions beide the dimensions which are part of the hypercube.

If the arc is not a definition arc, the value will be ignored.

string contextElement = null

The context element attribute only appears on definition arcs. It appears on arcs with the all arc role and arcs with the not all arc role for defining hypercubes. It defines which container of the context dimension information should be stored for reporting a value for this hypercube. The only valid values are "segment" and "scenario". For definition arcs which have neither all nor not all arc role, nothing should be passed.

If the arc is not a definition arc at all, the value will be ignored.

string preferredLabelRole = nullDefines the URI of the element's label which should be used when displaying the item in the relationship defined by the arc. The class AMANA.XBRL.Engine.XbrlBaseConstants defines URIs of common label roles.

Using TableModels to generate Tables from the Table Linkbase

...