Title: Creating and Handling XBRL Instance Documents
1Creating and Handling XBRL Instance Documents
10th XBRL International Conference Brussels,
Belgium 15 November 2004, Education Day Track 2,
Session 2 Ian Stokes-Rees DecisionSoft Ltd.
2Overview
- Review of Motivation for XBRL
- XML Summary
- Components of Instance Documents
- Working with Instance Documents
- Demonstration
3Why Are We Interested in XBRL?
- Standard, interoperable format
- Wholly extensible
- Gains in usefulness of data
- Compare proprietary binary formats
- Increased transparency
- Because Everyone elses is doing it
- XML was designed to address many of these issues
4Technology stack
5XBRL Architecture
6XBRL Instance Documents
- XBRL instances contain the facts being reported
while the taxonomies define the concepts being
communicated by the facts. - The combination of an XBRL instance and its
supporting taxonomies, and additional linkbases
constitute an XBRL business report. - -- XBRL specification, Section 3
7XBRL Review
- We have already learnt how Taxonomies define a
set of possible reporting facts - And how these taxonomies are created by a
- Business
- Professional body
- Industry sector
- Governmental organisation
- International organisation
- Linkbases are used to connect and annotaate XBRL
Facts and for presentation - XML is used for all XBRL files
8Short XML Summary
- ltnselement_name
- attributeattribute valuegt
- element value
- lt/nselement_namegt
- Looks similar to HTML (but not quite the same!)
- Case sensisitve (unlike HTML)
- Angle brackets (ltgt) are used to delimit open and
close tags - Open (lttaggt) and close (lt/taggt) tags must be
matched and must be balanced (nested correctly)
(unlike HTML) - Namespaces (e.g. ns) are used to scope
(associate) an element or attribute with a
particular schema (Taxonomy) - Comments are enclosed in lt!-- a comment --gt
9Bag of Facts
- An XBRL Instance document is a
- Bag of Facts
- Un-ordered
- Un-associated
- Each fact must be unique
- Each fact must be defined in a Taxonomy
10A Simple Fact
- Consider the following piece of information
- Total Annual Revenue 25,544,000.00
- Let's say we find an XBRL Taxonomy item
definition called - TotalRevenue
- Then we could represent (i.e. encode into XBRL)
this fact as - ltTotalRevenuegt25544000.00lt/TotalRevenuegt
- So simple, it isn't valid XBRL
11Facts and Taxonomies
- But who defined TotalRevenue?
- Our companies finance department?
- The GAAP?
- The Government?
- It must be defined in some relevant Taxonomy, and
we must associate our fact with that Taxonomy
12Adding Taxonomy Reference to Facts
- This is done using XML Namespaces
- Let's say TotalRevenue comes from the GAAP
Taxonomy, then we write - ltgaapTotalRevenuegt
- 25544000.00
- lt/gaapTotalRevenuegt
- In fact, gaap is just a Namespace Reference
- We will have to define exactly which XBRL
Taxonomy Namespace gaap is associated with later
13Facts and Contexts
- Now we must ask How will someone else know
TotalRevenue is for the entire year, and not just
this quarter, and which year are we talking about
anyway? - This is done using Contexts
- Every fact must specify a context
- Our fact would now appear as
- ltgaapTotalRevenue
- contextRefc_2003_FYgt
- 25544000.00
- lt/gaapTotalRevenuegt
14Defining Contexts
- But what does c_2003_FY mean?
- This is just a reference to a real context
definition - The definition must supply
- A time period during which the context applies
- Usually a range
- May be an instant
- May be indefinite (forever)
- An owning entity for the context
15Defining Contexts (II)
- ltcontext id"c_2003_FY"gt
- ltentitygt
- ltidentifier scheme"uriietf.org"gtacme.comlt/identi
fiergt - lt/entitygt
- ltperiodgt
- ltstartDategt2003-01-01lt/startDategt
- ltendDategt2003-12-31lt/endDategt
- lt/periodgt
- lt/contextgt
- Parts in Green Italics we have control over
- Contexts are typically reused by several facts
16Fact Uniqueness
- Imagine a comprehensive XBRL Report for an entire
financial year - Quarterly summaries
- Annual summaries
- Can imagine 5 occurances of TotalRevenue
- One for each quarter, and one for full year
- XBRL Specification requires that each
Fact/Context pair be unique - Illegal to have any ambiguity
17Facts and Units
- Questions still remain In what currency is
TotalRevenue specified? - This is similar to context
- A unitRef attribute is added to the fact
- ltgaapTotalRevenue
- contextRefc_2003_FY
- unitRefu_USDgt
- 25544000.00
- lt/gaapTotalRevenuegt
- A definition of that unit is made elsewhere
- ltunit id"u_USD"gt
- ltmeasuregtUSDlt/measuregt
- lt/unitgt
18Facts and Precision
- One last question
- How precise is the fact?
- How many significant figures?
- Has it already been rounded?
- Add precision (or decimal) attribute
- ltgaapTotalRevenue
- contextRefc_2003_FY
- unitRefu_USD
- precision5gt
- 25544000.00
- lt/gaapTotalRevenuegt
19Non-numeric Facts
- General text can also be used for XBRL Facts
- Very similar to the numeric facts we have looked
at so far - Only differences
- No precision (or decimals)
- No units
- Still need to include
- Taxonomy (via namespace)
- Context (via contextRef attribute)
20Summary of Facts Data Types and Attributes
- Available types
- monetary
- shares
- numeric
- fraction
- string
- boolean
- also other, arcane types
- Derived types
- Attributes
- contextRef
- unitRef
- precision
- decimals
- id
- Various rules
- Spec 4.6
21Tuples
- Group related items
- when not independent
- No context for the tuple itself
- context for contained items (facts)
- Example
- management information
- See the specification, section 4.9
- Together with items (facts), known as "concepts"
22Tuple Example
- We may want a structured fact to represent the
Corporate HQ Address - ltgaapCorporateAddressgt
- ltgaapBuildinggtLawrence Towerlt/gaapBuildinggt
- ltgaapStreetgtPenn Ave.lt/gaapStreetgt
- ltgaapCitygtPittsburghlt/gaapCitygt
- ltgaapStategtPAlt/gaapStategt
- ltgaapZipCodegt15733lt/gaapZipCodegt
- ltgaapCountrygtUSAlt/gaapCountrygt
- lt/gaapCorporateAddressgt
- Cheating every nested fact needs a context
attribute
23ltxbrlgt Wrapper
- We can now create a collection of facts, with
their associated context and unit definitions - These pieces must be placed inside an ltxbrlgt
wrapper element, along with some other special
xbrl elements
24Outline of XBRL Instance Document
- ltxbrl
- xmlns "http//www.xbrl.org/2003/instance"
- xmlnsgaap
- "urnexample.comgaap-2003"gt
- lt!-- taxonomy refs --gt
- lt!-- linkbase refs --gt
- lt!-- facts --gt
- lt!-- tupples --gt
- lt!-- contexts --gt
- lt!-- units --gt
- lt/xbrlgt
25Namespace Declarations
- This declares the default (un-prefixed) XML
elements are all defined by the XBRL Instance
Document schema - xmlns"http//www.xbrl.org/2003/instance"
- This declares that any element prefixed by gaap
is part of the GAAP 2003 Taxonomy - xmlnsgaap"urnexample.comgaap-2003"
- Other Taxonomy references can be included in a
similar fashion - For our purposes (slight over-simplification)
- Taxonomy ltgt Schema ltgt Namespace (synonyms)
26Discoverable Taxonomy Set (DTS)
- The set of Taxonomies to be used in the XBRL
Instance Document must be specified using
schemaRef elements - ltlbschemaRef xltype"simple"
- xlhref"http//www.example.com/gaap/2003.xsd"/gt
- This says We are using Taxonomy items defined in
the 2003.xsd Taxonomy Schema Definition - Multiple Taxonomies can be included this way
- The set of all Taxonomies is called the
Discoverabale Taxonomy Set (DTS)
27Linkbases
- Five types, used to make connections between
Facts and Taxonomies or other sources - Label
- Human readable name for a particular fact
- Definition
- Specific meaning of a particular fact
- Presentation
- Formatting details regarding how to display the
bag of facts - Calculation
- Indicates how a set of numeric facts result in
another fact (creating an equality) - Reference
- Cite authoritative literature or standard
28Linkbase References
- ltlblinkbaseRef xltype"simple"
- xlhref"some_linkbase.xml"
- xlarcrole
- "http//www.w3.org/1999/xlink/properties/linkbase"
- xlrole"SEE LIST BELOW"/gt
- There are five possible values for xlrole
- http//www.xbrl.org/2003/role/calculationLinkbaseR
ef - http//www.xbrl.org/2003/role/definitionLinkbaseRe
f - http//www.xbrl.org/2003/role/labelLinkbaseRef
- http//www.xbrl.org/2003/role/presentationLinkbase
Ref - http//www.xbrl.org/2003/role/referenceLinkbaseRef
- These depend on the type of linkbase specified
- Actual Linkbase file is separate from Instance,
and is likely to be re-used between many instance
documents
29Summary To Date
- We have now covered all the essential parts
contained within an XBRL Instance Document - Facts
- Tuples
- Contexts
- Units
- Taxonomy References (DTS)
- Linkbase References
- Any questions?
30XBRL Within the Enterprise
- Consider where financial business reporting
information exists within the enterprise - Accounts Receivable paper invoices
- Ledgers, notebooks, and desktop PCs
- Excel files
- Corporate Financial Management software
- Annual and quarterly reports
- Historical archives
31Lifecycle
- Gather
- Verify
- Collate/Summarise
- Publish
- Distribute
- Consume
- Archive
32Managing XBRL
- In a production environment, no one should ever
see any angle brackets, namespaces, or XML - XML is simply the standard underlying data format
for all XBRL information - We have focused on it here to present the XBRL
standard pedagogically, but these details are
only important for the technical
developer/integrator - Tools Tools Tools
33Working with XBRL
- Database integration/interfacing
- Many databases can output XML
- Conversion from custom applications
- Excel
- Financial Management Software
- Validating XBRL Reports
- Displaying XBRL Reports
- Managing collections of Reports
- Versioning
- Archiving
34Technology stack
35Tools and Integration
- XBRL, at its core, is just XML
- Therefore an enormous number of tools already
exist to work with XML - However there are two problems
- You are left with a constructor set
- Aspects of XBRL processing require special
handling - Many vendors here at the Conference with XBRL
Tools and Integration Support - DecisionSoft and Software AG among them
36DOM and SAX APIs
- There are two standard XML processing APIs
- DOM Document Object Model
- Creates in-memory tree representation of XML
files - SAX Simple API for XML
- Produces event messages as it parses XML
- Developer responsible for implementing listeners
to process events - Both available in all languages
37Transforming XML
- XSLT XML Stylesheet Language Tranfsormation
- Standard way to convert one XML file into another
XML file - Requires a different way of thinking
- Programmatic XML transformation via DOM or SAX
also possible - And sometimes preferrable
- This is also important when attempting to merge
Reports
38Validation
- This is one of the most critical component of all
XBRL processing - Make sure the data is correct
- Facilitate interoperability
- Reduce programming effort
- Most code is often input data checking and
exception handling - Reject rubbish
39Levels of Validation
- Well-formedness
- Correct syntax
- Validity XML Schema
- Structures
- Datatypes
- Application level
- Cross-field
- External
- XBRL specific
40Validating XBRL
- Must check taxonomies and reports
- Levels of correctness
- Well-formed XML
- XML Schema validity
- XBRL specification
- Taxonomy
- Including linkbases
- Need tools
- See xbrl.decisionsoft.com
41XML Validation
- Well-formed
- syntax not content
- Examples
- Correct nesting of tags
- Acceptable tag and attribute names
- Character set and encoding
42XML Schema Validation
- Structure
- Vocabulary
- The right tags and attributes
- Correct occurence of elements
- Correct nesting of elements
- Data-type
- Type string, date, integer, etc.
- Static constraints
- EG minimum and maximum values
43XBRL Validation
- Covers specification and taxonomy
- Builds on XML Schema
- Additional validation includes
- Linkbase integrity checking
- Cross-field validations
- Calculations
- Formula linkbase
44DemonstrationXBRL Instance DocumentsValidation
45Conclusion Systems
46Conclusion Standards
47Questions?Also talk to us at the Break or at
the DecisionSoft booth
48System considerations
- Validation
- Components
- Documentation
49Key Components of an XBRL System
- Taxonomy definition
- Additional rules
- Submission mechanism
- Transport
- Protocol
- Security
50Developers' Perspective
- What do they want?
- Schema/taxonomy
- How do I map to it?
- Simplicity
- Clear documentation
- How do I check my implementation?
- Test services
- How do I get it to them?
- Standard transport mechanisms
51Ensuring adoption
- New technology
- Make it easy
- Publish
- Taxonomy
- Additional validation rules
- Documentation
- Samples
- Test service
52When To Choose XBRL
- XBRL is good for
- Tabular data
- Data intended for humans
- Reports
- Extensibility
- Meeting existing standards UK GAAP, IFRS
- Other XML is better for
- Structured data
- Data intended for systems
- Transactions
- Rigidity
53Sample Financial Report