3_XBRL_Pijls

advertisement
ICT and Accounting: XBRL
Course ICT & Economics
March 15, 2010
W. Pijls
1
Overview
•Introduction
•XML
•XBRL=
eXtensible Business Reporting Language
•Example: Dutch Taxonomy
•Miscellaneous
Focus in this talk is on the
`architecture' of XBRL.
2
What is XBRL?
XBRL is a language for financial reporting,
to be used in annual reports, income statements, balance sheets.
(XBRL is an open standard, comparable to EDI in logistics).
XBRL was designed in 1999 by Charles Hoffman CPA.
Initially XBRL-FR (FR=Financial Reporting) was designed, for external
accounting.
In 2005 XBRL-International published the XBRL-GL specification.
(GL=Global Ledger) for internal accounting.
The current version is XBRL 2.1 (differs strongly from 2.0 and 1.0 !) .
see: http://www.xbrl.org/SpecRecommendations/
3
The global organisation is XBRL International.
www.xbrl.org
Many countries have local XBRL organisations.
In the Netherlands: XBRL-Nederland, www.xbrl-nederland.nl.
Some countries have national jurisdictions governing the adoption
of XBRL.
In the Netherlands: XBRL Dutch Taxonomy Project or in Dutch:
XBRL-NTP, www.xbrl-ntp.nl.
Ministries of Finance and Justice, KvK (Chamber of Commerce),
Tax service, CBS (Statistics Agency), Accounting firms (Big 4)
and Banks are participants in XBRL-NTP.
4
XBRL is based upon
XML=eXtensible Markup Language
Unfortunately:
The specification and definition of XBRL is very complex!
From the viewpoint of a computer scientist,
there are several objections.
5
XBRL is based upon
XML=eXtensible Markup Language
An important application of XML is data representation.
Nowadays we have XML databases.
XML is a language to store data, next to SQL, Excel, csv, etc.
When you have data, you need metadata.
XML has two methods to implement metadata,
i.e. language to define datatypes or datastuctures.
-DTD (Data Type Definition)
-Schema
-(NG Relax)
6
Example
<booklist>
<book>
<title>Ulysses</title>
<author>James Joyce</author>
</book>
<book>
<title> The Lord of the Rings </title>
<author>J. Tolkien</author>
</book>
</booklist>
The building block is an element.
<name_element>
data </name_element>
Elements can be nested.
7
DTD
A DTD file describes the structure of an XML file using EBNF
(Extended Backus-Naur Form) is known from programming
languages, which are also described by BNF.
The structure of the previous XML-file:
<!DOCTYPE
<!ELEMENT
<!ELEMENT
price)>
<!ELEMENT
<!ELEMENT
booklist[
booklist(book+)>
book(title, author|editor, publisher,
title(#PCDATA)
author(#PCDATA)
etc.
]>
PCDATA=parser character data
8
The same XML-file described by a schema in `books_schema.xsd'
(suffix xsd=xml schema definition).
<schema
<element name="booklist">
<complexType>
<sequence>
<element name=“book” maxOccurs="unbounded">
<complexType>
<sequence>
<element name="author" type=string>
<element name="title" type=string>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</schema>
9
Instead of nesting, we may use "ref".
booklist and book and defined separated (not nested).
<schema>
<element name="book"
...... consists of title and author
</element>
<element name="booklist" >
<complexType>
<sequence>
<element ref=“book” maxOccurs="unbounded">
<sequence>
<complexType>
</element>
</schema>
10
in EBNF author|editor, but in a schema:
<choice>
<element name=“author”/>
<element name=“editor”/>
</choice>
Another important feature of XML is the attribute.
<book>
<title>Ulysses</title>
<author>James Joyce</author>
<year>1922</year>
</book>
attribute
using attributes:
<book year=1922>
<title>Ulysses</title>
<author>James Joyce </author>
</book>
11
Another feature: restriction.
In Schema:
<element name="day">
<simpleType>
<restriction base="string">
<enumeration value="Sunday"/>
<enumeration value="Monday"/>
<enumeration value="Tuesday"/>
....
</restriction>
</simpleType>
</element>
In XML data file:
<day>Tuesday</day>
12
It is also possible to define just a type (using other types) somewhere
in the schema.
<simpleType name="daytype">
<restriction base="string">
<enumeration value="Sunday"/>
<enumeration value="Monday"/>
....
</restriction>
</simpleType>
This can be applied in an element definition:
<element name="date"
<sequence>
....
<element name="day" type="daytype"/>
13
To validate the XML file, the XML file may include the following
attribute, referring to the schema file:
<booklist schemaLocation=“books_schema.xsd">
<book>
...............
</booklist>
14
An XML feature very important in XBRL: Namespaces
In a Schema or an XML data file:
xmlns:john=“http://peter”
<john:book>
………. </john:book>
equivalent to:
<http://peter:book>
…
In other words: john is a substitute or alias for http://peter
Namespaces are crucial, when an xml of xsd file uses datatypes
from multiple schema files.
15
The relation between schemas and namespaces.
Schema with filename “books_schema.xsd” (cf slide 9):
<schema targetNamespace="http://books_namespace">
<element name=“booklist”
…../>
..........
</schema>
Every element in the above schema, when used in other xml of xsd files, must have
the prefix given by the targetNamespace.
XML file containing the book data
<foo:booklist
xmlns:foo="http://books_namespace"
schemaLocation="http://xxx/books_schema.xsd">
<foo:book> ……
</foo:book>
.............
16
Extension, the import construct
Suppose you want to extend the schema of the books schema, i.e., you want to add
new elements. The new schema is "second_schema.xsd".
<schema targetNamespace="http://second_namespace"
xmlns:abc="http://books_namespace">
<import namespace="http://books_namespace“
schemaLocation=“books_schema.xsd"/>
<element name=“cd_rom”
…../>
<element
name="collection" ...<sequence> ref="abc:book" .../>
So the following elements are available in other xml or xsd files:
http://books_namespace:book
http://second_namespace:cd_rom
http://second_namespace:collection
17
A reference to (only) the extended schema (filename “second_file.xsd”) is
needed in an xml or xsd file.
See for instance the following xml file.
<pqr:collection
schemaLocation=“second_file.xsd"
xmlns:klm=“http://books_namespace”
xmlns:pqr=“http://second_namespace”/>
<klm:book> …
<pqr:cd_rom> …..
second_schema.xsd
second_namespace
import
books_schema.xsd
books_namespace
18
Any schema needs the namespace for defining the schema tags.
<xsd:schema
xmlns xsd="http://www.w3.org/2001/XMLSchema"
<!– the general namespace for elements in schemas -->
xsd:targetNamespace="http://second_namespace">
<xsd:import
xsd:namespace="http://my_namespace“
xsd:schemaLocation=“filename.xsd"/>
<element name=“cd_rom”
…../>
It is possible to define an empty prefix:
xmlns ="http://www.w3.org/2001/XMLSchema"
(Elements without prefix are related to the namespace with empty prefix)
empty namespace
19
One more feature: substitutionGroup
An element in a schema is actually a definition of a datatype or
(in OO terminology) a class.
The substitutionGroup in XML is the counterpart of the subclass
concept in OO.
<element name="medium"
............../>
<element name="book", substitutionGroup "medium"
.../>
20
XBRL
The basic schema for XBRL is:
http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd
with targetnamespace
http://www.xbrl.org/2003/instance.
The most important elements defined in this schema are:
•item (contains a context and a unit) also called concept
•context (period or time)
•scenario
•unit (currency)
21
A common xbrl schema (.xsd –file) contains financial items.
Here are some fragments of a common .xsd-file:
targetnamespace"my_Taxonomy"
xmlns:xbrli="http://www.xbrl.org/2003/instance"
<import
namespace="http://www.xbrl.org/2003/instance"
schemaLocation="http://www.xbrl.org/2003/
xbrl-instance-2003-12-31.xsd" />
<element
id="Assets"
name="Assets"
substitutionGroup="xbrli:item"
type="xbrli:monetaryItemType"
xbrli:periodType="instant"/>
22
An xbrl data file (an .xbrl-file) is called an instance.
A fragment of an instance:
<xbrli:context id="B2009">
<xbrli:period>
<xbrli:instant>
2009-12-31
</xbrli:instant>
</xbrli:period>
<xbrli:scenario>
Vastgesteld (consolidated)
</xbrli:scenario>
</xbrli:context>
euro
<xbrli:unit id="u2">
<xbrli:measure>iso4217:EUR</xbrli:measure>
</xbrli:unit>
<my_Taxonomy:Assets, contextRef="B2009 unitRef="u2">
30000
</my_Taxonomy:Assets>
23
The IASB (International Accounting Standards Board) defined
IFRS (Int. Financial Reporting Standards).
The translation of the IFRS items is implemented in the file:
IFRS-GP-2005-05-15.xsd
(GP=General Purpose)
which can be found on:
http://www.iasb.org/XBRL/IFRS+Taxonomy/Previous+taxonom
ies.htm
National regulators have designed new schemas on top of the ifrsschema. So most national schemas import the ifrs schema and define
additional new financial items.
24
An XBRL taxonomy is usually a
stack of schema files.
(US: GAAP)
25
An xbrl schema is usually a long list of items
(more formally: a list of elements where each element belongs
to the substitutionGroup `xbrli:item').
An instance (=xbrl data file) consists usually of
-some units (currencies)
-some contexts (periods of instants)
-a long list of items (with a unit and a context as attributes)
The global stucture of a schema and an instance is linear,
i.e., there is hardly any nesting.
26
A set of XBRL metadata is called a Taxonomy.
(or DTS=Discoverable Taxonomy Set)
A taxonomy consists of (one or more) schema(s) and a set of
linkbases. A schema refers to some linkbases.
Five types of linkbases.
•Label linkbase
•Presentation linkbase
•Calculation linkbase
•Reference linkbase
•Definition linkbase
The next slides show parts of a label and a presentation linkbase
27
<label xlink:label =
"kvkrj_RepaymentOtherFinancialLiabilities_lbl"
xlink:role="http://www.xbrl.org/2003/role/label"
xlink:type="resource"
xml:lang="nl">
Aflossing van financiele verplichtingen </label>
<loc xlink:href =
"kvk-rj.xsd#kvk-rj_RepaymentOtherFinancialLiabilities"
xlink:label=
"kvk-rj_RepaymentOtherFinancialLiabilities_loc"
xlink:type="locator"/>
<labelArc xlink:arcrole =
http://www.xbrl.org/2003/arcrole/concept-label"
xlink:from =
"kvk-rj_RepaymentOtherFinancialLiabilities_loc"
xlink:to=
"kvk -rj_RepaymentOtherFinancialLiabilities_lbl"
xlink:type="arc"/>
28
<link:loc xlink:href=
"basis/kvk-rj/kvk-rj.xsd#kvk-rj_AssetsPresentation"
xlink:label="lbl_AssetsPresentation1"
xlink:type="locator"/>
<link:loc xlink:href=
"basis/kvk-rj/kvk-rj.xsd#kvkrj_FixedAssetsPresentation"
xlink:label="lbl_FixedAssetsPresentation"
xlink:type="locator"/>
<link:presentationArc
order="2"
xlink:arcrole="http://www.xbrl.org/2003/arcrole/parentchild"
xlink:from="lbl_AssetsPresentation1"
xlink:to= "lbl_FixedAssetsPresentation"
xlink:type="arc"/>
29
If a schema A refers to a linkbase and this linkbase contains a
locator (`loc') to an element E in a schema B, then this
element E is supposed to be imported in schema A.
So linkbases are also used as an improper method to import
parts of other schemas.
30
In the Semansys taxomy viewer
the presentation links are used
for indentation.
(different from other viewers).
Taxonomies have one location on
Internet.
XBRL processing software
must download the taxonomies
from Internet.
You may only refer to globally
available schemas
31
<xbrli:xbrl
xmlns:xbrli="http://www.xbrl.org/2003/instance"
xmlns:iso4217="http://www.xbrl.org/2003/iso4217"
xmlns:link="http://www.xbrl.org/2003/linkbase"
xmlns:xlink="http://www.xbrl.org/2003/XLink"
xmlns:role="http://www.xbrl.org/2003/role"
xmlns:arcrole="http://www.xbrl.org/2003/arcrole"
xmlns:myschema="http://www.pijls.com/xbrl/taxonomy"
schemaLocation=
"http://www.pijls.com/xbrl/taxonomy/schemaname.xsd"
>
Any instance starts with a lot of namespaces.
Why all these namespaces?
32
Software.
There are several XBRL tools available which show and construct
taxonomies and instances in a human readable style.
-Altova MissionKit, www.altova.com
-Fujitsu,
http://software.fujitsu.com/en/interstage-xwand/
activity/xbrltools/index.html-Semanys (Zoetermeer) www.semanys.com
-Reporting Standard, http://www.reportingstandard.com/
-XBRL core (open source), java library
http://sourceforge.net/projects/xbrlcore/
33
The xbrl tools show
different views.
Example: instances Model-D
in Altova (on top) and
Fujitsu (on the right)
34
National regulators have designed new schemas on top of the ifrs-schema,
cf. slide 21.
-Netherlands: NTP, Dutch Taxonomy Project
Taxonomies for Tax declaration (BD) , Chamber of Commerce (Kvk), Statistics
Agency (CBS) , Bank (in case of bank credit).
www.xbrl-ntp.nl
-Belgium, Central bank has made available multiple taxonomies for multiple
purposes:
www.nbb.be/pub/03_00_00_00_00/03_08_00_00_00/03_08_01_
00_00.htm?l=nl
or:
=en
-US, UK, France, Spain, Australia, Germany, ….
Unfortunately, many differences arise between the
taxonomies, even in the data structures.
35
Taxonomy of Belgium, defining the postal code.
in the schema
postal code
for Brussels
<element name="XCode_PostalCode_1000"
type="xbrli:stringItemType"
fixed="1000"
substitutionGroup="pfs-gcd:PostalCodeHead"
id="pfs-vl_XCode_PostalCode_1000" />
in the
<label xlink:label="XCode_PostalCode_1000_lab"
label
xml:lang="fr">Bruxelles</label>
linkbase
<label xlink:label="XCode_PostalCode_1000_lab"
xml:lang="nl">Brussel</label>
<label xlink:label="XCode_PostalCode_1000_lab"
xml:lang="de">Brüssel</label>
<label xlink:label="XCode_PostalCode_1000_lab"
xml:lang="en">Brussels</label>
In the Dutch taxonomy, a postal code is a string
with four digits and two capitals.
36
Dutch Taxonomy.
Three layers.
Basis contains
-ifrs-gp schema (with labels in Dutch)
-additional dutch basic `generic' elements (not domain related)
-common data (data structures for name, address, city, phone, country codes, ...)
Domains contains
-domain related items (BD, KvK, CBS)
-formsets,
a formset is a schema containing only a link reference to a presentation
linkbase (so no new elements);
an instance obeying the formset should include just the elements mentioned in
the linkbase
Reports, a report is a collection of formsets, a report imports schemas from
formsets.
37
38
XBRL in Belgium
39
Adoption world wide.
-US SEC, reporting in xbrl is required
-Belgium `Balanscentrale' (Chamber of Commerce)
reporting in xbrl is required
-China, Korea, Japan, xbrl is required
-In almost any country of Western Europe, reporting in xbrl
is enabled
-Netherlands: BD, KvK and CBS are xbrl enabled.
40
Advantages XBRL
-SBR = Standard Business Reporting.
Any company has the same report structure
(beneficial for KvK and banks).
A company can use its report for multiple purposes.
E.g. `Samenval van fiscaal en commercieel jaarverslag'
-Annual report can be derived from the Ledger (`Grootboek')
automatically.
-Continous reporting and continous auditing is enabled.
41
Disadvantage.
-XBRL files are very long,
not efficient from a computer scientist's viewpoint.
-Much redundancy
-Viewers are slow
Apart from the formal specifications there are extra rules in:
FRTA
FRIS
FRIS-NL-BD
FRIS-NL-KvK
(see the websites).
42
Assignment.
Study a schema-file in the Dutch (or Belgian) Taxonomy,
e.g. Chamber of Commerce, balance sheet.
The items are specified in other import schemas.
Where is each item defined?
Put another way, describe the architecture in detail.
43
Download