Thursday, September 1, 2011

Fundamentals of Extensible Business Reporting Language

What is Extensible Business Reporting Language (XBRL): XBRL is an XML based reporting standard mainly designed for financial reporting. However, just like any XML based format, the XBRL standard is open enough to fit into other purposes as well. Most developed countries use XBRL for all financial reporting purposes. There are many documentation about XBRL which are suited to the accounting professionals and business men. However, there is a scarcity of technical documentation. So, I will explain the essential concept of XBRL in this text. Please note that XBRL specification is a very complex specification and it would require more than one article to explain properly. Please stay tuned for more articles.

The following URL will give an idea about how an XBRL document might look in a human readable view http://www.sec.gov/cgi-bin/viewer?action=view&cik=1419793&accession_number=0001144204-11-051027&xbrl_type=v# An XBRL report consists of mainly two kinds of XML documents - taxonomy and instance.

Taxonomy: Taxonomy defines the structure of the document. It contains the definition of the tags that are used in the report. XBRL uses W3 Schema for this purpose. The taxonomy also contains linkbase documents which are XML documents containing XLinks. If you do not know how XLinks work, please visit the link. If you do, please read on. Linkbases define the relationships between the tags, or between tags and some other information contained in the taxonomy. For example, a link can attach a human readable name to a tag, or it can define in which place a tag will appear in a human readable view of the XBRL document. Please note that XBRL makes heavy use of XLink, please read about XLinks before you continue.

Instance: The instance is the XML document that contains the actual data, by instantiating the tags defined in the taxonomy schema documents. This data contained in the instance document coupled with the taxonomy creates a complete XBRL representation of data. Its possible to analyze the data as well as to create nice human readable views for these data through a computer software.

Concept: A concept is an idea. In XBRL, a concept is represented by an element definition in the taxonomy schema documents. A concept element definition must be in the substitution group of either a item element or tuple element in the XBRL instance namespace (http://www.xbrl.org/2003/instance).
What is Substitution Group: Substitution group is a feature in XML schema to replace one element with another. Say I have the following schema definitions.

<element name="a">
    <sequence>
        <element ref="b"/>
        <element ref="c"/>
    </sequence>
</element>

Now if somewhere d is defined to be in the substitution group of b as follows

<element name="d" type="string" substitutionGroup="b"/>

Then the following XML snippet will be valid

<a>
    <d/>
    <c/>
</a>

Note that all elements in the substitution group must be globally declared elements.


Items and Tuples: Items and tuples are both concepts. Items appear in the instance as single elements without subelements. Tuples on the other hand contains subelements. Subelements of tuples must be either tuples or items. In other words, tuples have complexTypes and items have simpleTypes.

Presentation Linkbase: Presentation linkbase is a linkbase containing links that defines relationship between tags about how the tags will be arranged in a human readable presentation of the data. Presentation links present in the presentation linkbase define a hierarchical relationship between different tags defined in the schema documents. (If you do not know about XLink, read XLinks). The presentation links must be the tag presentationLink, the arcs in it must be called presentationArc and the locators must be called loc. The xlink:role attribute in the presentationLink element will be used to group links together, so that all links with the same role fall under the same group. The arcs (after differencing the from and to attributes to the target elements) will form the resulting relationship. The following shows an example of presentation link

<presentationLink xlink:type="extended" xlink:role="http://www.geekyarticels.com/somerole/">
    <loc xlink:type="locator" xlink:href="abc.xsd#a" xlink:label="a" xlink:title="presentation: A"/>
    <loc xlink:type="locator" xlink:href="abc.xsd#b" xlink:label="b" xlink:title="presentation: B"/>
    <presentationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/parent-child" xlink:from="a" xlink:to="b" xlink:title="presentation: A to B" use="optional" order="1.0"/>
</presentationLink>


The above presentation link simply represents that b is a child of a. It means a presentation must have the element a seen as a parent of b. Note that in the instance document both a and b may be top level elements (global items). A top level element is the element directly under the root tag. Now why do we not simply add tag b inside the tag a instead of first having both as top level elements and then apply a linkbase to apply the hierarchy? Because it enables us to include the tag b multiple times under multiple parents in the human readable view. The instance document would still report the value only once, but the value will be visible (may be with different names) at different places in the human readable view of the XBRL document.

The order attribute of the presentationArc element determines the order of the elements inside the presentation parent. The order is actually a decimal number enabling insertion of elements between existing ones easier.

Calculation Linkbase: Calculation linkbase defines summation relationships between the elements. Say for example, we need to establish the relationship a=0.3*b-0.7*c. It can be done using the following link.

 <link:calculationLink xlink:type="extended" xlink:role="http://www.geekyarticels.com/somerole/">
    <link:loc xlink:type="locator" xlink:href="abc.xsd#a" xlink:label="a" xlink:title="a"/>
    <link:loc xlink:type="locator" xlink:href="abc.xsd#b" xlink:label="b" xlink:title="b"/>
    <link:loc xlink:type="locator" xlink:href="abc.xsd#c" xlink:label="c" xlink:title="c"/>
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="a" xlink:to="b" xlink:show="replace" xlink:title="calculation: SourcesofFunds to ShareholdersFunds" order="1.0" weight="0.3"/>
    <link:calculationArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/summation-item" xlink:from="a" xlink:to="c" xlink:show="replace" xlink:title="calculation: SourcesofFunds to ShareholdersFunds" order="1.0" weight="-0.7"/>
</link:calculationLink>


Note that the from element is the result of summing up the to elements multiplied by the weight attributes of the corresponding calculationArc.

Label Linkbase: The presentation linkbase tells us about the organization of the tags in the human readable view. However, it does not tell us anything about what the data will be called in a human readable view of the document. For example, a tag may be called TotalAssets. In a human readable view, it should instead be called Total Assets [Some description here]. Label links assign a description to a tag. Unlike presentation and calculation links, label links use local resources as the target of the labelArc. The following shows an example of labelLink.

<labelLink xlink:type="extended" xlink:role="http://www.xbrl.org/2003/role/link">
    <loc xlink:type="locator" xlink:href="abc.xsd#a" xlink:label="a"/>
    <label xlink:type="resource" xlink:label="l" xlink:role="http://www.xbrl.org/2003/role/label" xlink:title="A" xml:lang="en" id="label_a">Sample Tag A</label>
    <labelArc xlink:type="arc" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:from="a" xlink:to="l"/>
</labelLink>


In the view, the tag a will appear as "Sample Tag A". Also note that the label tag (which is a resource element) has its own xlink:role element. This role can be used in the profferedLabel attribute of presentationArc element to choose which label to use in a particular position in the view in case the tag has multiple labels associated with it.

Instance Documents: The instance document contains the actual data. In most cases, all data are contained in the top level tags. The instance document always follows the schema at http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd. The root tag is always xbrl. However, an XBRL instance can appear within a wrapper XML. The fact appear by virtue of being in the substitutionGroup of either item or tuple.

Contexts: In the instance document, context is used to define the entity for which a particular fact apears and the time period for which the data has been reported. Context can contain more information than this. But we will see that later. The period in the context mostly either contain a instant date (or date time) or a pair of dates (date-times) as startDate and endDate. If the context is associated with the data that are valid forever, a <forever/> tag can appear in the period of a context. Every fact in the instance must point to a context through its contextRef attribute, which must be equal to the id of the context element.

Units: In addition, every numerical fact must point to a unit element through the unitRef attribute. In XBRL, units are formed by multiplying or dividing measures. The following shows a sample instance document.

<xbrl xmlns="http://www.xbrl.org/2003/instance" xmlns:geeky="http://www.geekyarticles.com/XBRL/" >
    <context id="c1">
      <entity>
         <identifier scheme="http://www.geekyarticles.com/XBRL/scheme">Demo</identifier>         
      </entity>
      <period>
         <startDate>2011-08-11</startDate>
         <endDate>2011-09-10</endDate>
      </period>
    </context>

    <context id="c2">
      <entity>
         <identifier scheme="http://www.geekyarticles.com/XBRL/scheme">Demo</identifier>         
      </entity>
      <period>
         <startDate>2011-09-11</startDate>
         <endDate>2011-10-10</endDate>
      </period>
    </context>

    <unit id="u1">
       <measure>xbrli:pure</measure>
    </unit>

    <geeky:a decimals="-2" unitRef="u1" contextRef="c1"> 2.01 </geeky:a>
    <geeky:a decimals="-2" unitRef="u1" contextRef="c2"> 5.49 </geeky:a>
</xbrl>


In the instance document, the value of a tag has been reported for the same entity and two different time periods.

Decimals and Precisions: You may notice in the above XML, we have used decimals attribute. The decimals attribute provides a way to specify the accuracy of the element. If the decimals is 2, it means the data is accurate upto 2 digits after the decimal place. If the decimals is -2, it means the data is correct upto two digits before the decimal point. There is another way to specify the accuracy of the data - through the precision attribute. The precision attribute reports accuracy in terms of significant digits. So a precisions attribute value of 2 means the data is correct upto 2 significant digits. The following table will clarify this more.

Tag Value Decimals Precision Effective Value
2.011 2 3 2.01
2.019 2 3 2.02
0.201 -1 1 0.2
20239 -1 4 20240


We have only scratched the surface now. XBRL is too vast to be covered in a single article. I have covered the very basic concepts in this articles. Stay tuned to read more detailed articles, highlighting each feature.

0 comments:

Post a Comment