Formula Linkbase Tutorial (afternoon)

Slides:



Advertisements
Similar presentations
XML-XSL Introduction SHIJU RAJAN SHIJU RAJAN Outline Brief Overview Brief Overview What is XML? What is XML? Well Formed XML Well Formed XML Tag Name.
Advertisements

Information Systems and Processes XBRL Formulae in a Nutshell Víctor Morilla VIII European Banking Supervisors XBRL Workshop Amsterdam November 2007.
XBRL Versioning Committee of European Banking Supervisors XBRL Network Vice-Chair VWG Katrin Schmehl Amsterdam, th European Banking Supervisors.
INFORMATION SYSTEMS AND PROCESSES BANK OF SPAINS XBRL FORMULAE SYSTEM IMPLEMENTATION AND CONCLUSIONS Víctor Morilla IT Project Manager of Bank of Spain.
Advanced XSLT. Branching in XSLT XSLT is functional programming –The program evaluates a function –The function transforms one structure into another.
Advanced XSLT II. Iteration in XSLT we sometimes wish to apply the same transform to a set of nodes we iterate through a node set the node set is defined.
CG0119 Web Database Systems Parsing XML: using SimpleXML & XSLT.
Internet Technologies1 1 Lecture 4: Programming with XSLT.
XSLT (eXtensible Stylesheet Language Transformation) 1.
XML: Managing Data Exchange Stylesheets. Lesson Contents CSS The basic XSL file XSL transforms Templates Sort Numbering Parameters and Variables Datatypes.
XML Flattened The lessons to be learned from XBRL.
Introduction to XSLT. What is XML? Design Goals of XML XML Format XML Declaration ElementsAttributes.
XBRL Pacific Rim Technology WorkShop & Summit Intern program Hiroaki Sakakibara Fujitsu Limited.
1 CP3024 Lecture 9 XML revisited, XSL, XSLT, XPath, XSL Formatting Objects.
Multi Platform Applications XML, XPath, XSLT transform.
XSL Concepts Lecture 7. XML Display Options What can XSL Transformations do? generation of constant text suppression of content moving text (e.g., exchanging.
XSL Unit 6 November 2. XSL –eXtensible Stylesheet Language –Basically a stylesheet for XML documents XSL has three parts: –XSLT –XPath –XSL-FO.
XML Workshop XSLT. XML Tagged data Hello A really interesting course, well taught Interchange of data RSS, BPEL4WS, RossettaNet … Structure document representation.
More XML XML schema, XPATH, XSLT CS 431 – February 21, 2005 Carl Lagoze – Cornell University acknowledgements to
Cornell CS 502 More XML XML schema, XPATH, XSLT CS 502 – Carl Lagoze – Cornell University.
XML –Query Languages, Extracting from Relational Databases ADVANCED DATABASES Khawaja Mohiuddin Assistant Professor Department of Computer Sciences Bahria.
17 Apr 2002 XML Stylesheets Andy Clark. What Is It? Extensible Stylesheet Language (XSL) Language for document transformation – Transformation (XSLT)
Case Studies in XBRL Solutions Formula developments for Multiple Instance processing Herman Fischer, UBMatrix and Mark V Systems.
10/06/041 XSLT: crash course or Programming Language Design Principle XSLT-intro.ppt 10, Jun, 2004.
XML and XSL Institutional Web Management 2001: Organising Chaos.
XML – Extensible Markup Language XML eXtensible – add to language. Markup – delimit info using tags. Language – a way to express info.
CSE3201/CSE4500 XPath. 2 XPath A locator for elements or attributes in an XML document. XPath expression gives direction.
Xpath Xlink Xpointer Xquery Sources:
IS432 Semi-Structured Data Lecture 5: XSLT Dr. Gamal Al-Shorbagy.
XSLT for Data Manipulation By: April Fleming. What We Will Cover The What, Why, When, and How of XSLT What tools you will need to get started A sample.
Comparing XSLT and XQuery Michael Kay XTech 2005.
CSE3201/CSE4500 Information Retrieval Systems
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
Skip 2007 Current Issues in MIS The XML Language Foundation f - Clinton E. White, Jr Professor of Accounting & MIS Lerner College of B&E University.
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
Implementing Forms and Form Renderers in the Open Source Portfolio David McPherson, Chris Maurer Will Trillich, Janice Smith Materials by Sean Keesler.
Processing of structured documents Spring 2002, Part 2 Helena Ahonen-Myka.
1 16 th XBRL International Conference Practical Dimensions “No Primary Item Left Behind” December 5, 2007 Herm Fischer.
1 Credits Prepared by: Rajendra P. Srivastava Ernst & Young Professor University of Kansas Sponsored by: Ernst & Young, LLP (August 2005) XBRL Module Part.
1 XSLT An Introduction. 2 XSLT XSLT (extensible Stylesheet Language:Transformations) is a language primarily designed for transforming the structure of.
XSLT part of XSL (Extensible Stylesheet Language) –includes also XPath and XSL Formatting Objects used to transform an XML document into: –another XML.
XSLT Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Consolidation and Entity Mapping: New XBRL Solutions David vun Kannon KPMG LLP.
Database Systems Part VII: XML Querying Software School of Hunan University
1 Overview of XSL. 2 Outline We will use Roger Costello’s tutorial The purpose of this presentation is  To give a quick overview of XSL  To describe.
Information Systems and Processes XBRL at the Bank of Spain Experiences, problems and challenges Ángeles Lozano Víctor Morilla 1st Technical Meeting of.
More XML XPATH, XSLT CS 431 – February 23, 2005 Carl Lagoze – Cornell University.
XP New Perspectives on XML, 2 nd Edition Tutorial 7 1 TUTORIAL 7 CREATING A COMPUTATIONAL STYLESHEET.
Session II Chapter 3 – Chapter 3 – XPath Patterns & Expressions Chapter 4 – XPath Functions Chapter 15 – XPath 2.0http://
University of Nottingham School of Computer Science & Information Technology Introduction to XML 2. XSLT Tim Brailsford.
XP 1 XSLT II Robin Burke ECT 360. XP 2 Outline Conditionals Numbering Functions and operators Variables and parameters Named and recursive templates.
CSE3201/CSE4500 XPath. 2 XPath A locator for items in XML document. XPath expression gives direction of navigation.
XP 1 XSLT II Robin Burke ECT 360. XP 2 Homework #4 Forgot we hadn't covered "choose" becomes extra credit My books.xml didn't include descriptions.
Grouping Robin Burke ECT 360. Outline Extra credit Numbering, revisited Grouping: Sibling difference method Uniquifying in XPath Grouping: Muenchian method.
XSLT I Robin Burke ECT 360. Outline History / Terminology XSLT processing XSLT syntax XPath XSLT basics Lab.
Advanced Accounting Information Systems Day 34 XBRL Instance Documents and Taxonomies November 13, 2009.
ACG 6415 XBRL Instance Documents. XBRL Facts  Information Report  By a Specific Entity  Specific Period of Time  Specific Currency.
1 XSL Transformations (XSLT). 2 XSLT XSLT is a language for transforming XML documents into XHTML documents or to other XML documents. XSLT uses XPath.
Rendering XML Documents ©NIITeXtensible Markup Language/Lesson 5/Slide 1 of 46 Objectives In this session, you will learn to: * Define rendering * Identify.
1 XSLT XSLT (extensible stylesheet language – transforms ) is another language to process XML documents. Originally intended as a presentation language:
XBRL Module Part 3: XBRL Framework
Formula Linkbase Tutorial
Querying and Transforming XML Data
CWA3 Standardized roll-out package Part 2: XBRL Handbook for Declarers
Database Processing with XML
XBRL - eXtensible Business Reporting Language
XML Path Language Andy Clark 17 Apr 2002.
XML WITH CSS.
CS 431 – February 28, 2005 Carl Lagoze – Cornell University
More XML XML schema, XPATH, XSLT
Presentation transcript:

Formula Linkbase Tutorial (afternoon) David vun Kannon Phillip Engel KPMG LLP

WWSD? Remember! XBRL OTSOG W3C XBRL FL OTSOG XPath Therefore: and (What Would SQL do?)

Basic Design Decisions How important is extensibility? Do you need a linkbase or just appinfo? How important is it to fit into existing tool sets and thinking? Is FL A resource linkbase? Item – formula A relationship linkbase? Item – inputs (+ formula)

Linkbase Separates definition of formula from output item Allows prohibition and override Uses linkbase ideas popularized by XBRL 2.1 But Can’t use the linkbase element!

Top Level Design <fl:rulebase> <fl:formulaLink/> Except for substituting rulebase for linkbase, this is a standard XBRL linkbase, with extended link roles for DTS use. (Don’t want to break the DTS model!)

Inputs are buried in the formula formulaLink Design Inputs are buried in the formula <fl:formulaLink> <fl:formula/> <xl:loc/> <fl:formulaArc/> </fl:formulaLink> This is very similar to other (label, reference) “resource style” linkbases. Result element

formulaArc Design Only one arc role defined so far Item-formula

Formula Design <fl:formula xlink:type=“resource” xlink:label=“formula1” id = “myFormula1” > <fl:variable/> <fl:value/> <fl:result/> </fl:formula>

Variable Design <fl:variable name = “var1” select = “ci:Assets” filter = “ …XPath expression… ” /> What are you allowed to select? items, contexts, non-XBRL attributes? The idea of “free” variables.

Value Design <fl:value test = “ …Xpath expression…” select = “ …XPath expression…” /> Can use multiple value elements OR XPath 2.0 case construct in XPath expression.

Result Design <fl:result> <fl:resultPrecision/> <fl:resultUnit/> <fl:resultContext> <fl:resultEntity/> <fl:resultPeriod/> <fl:resultScenario/> </fl:resultContext> </fl:result>

FL OTSOG XPath! Bind variables Filter variables Result choices Compute results Express API into XBRL instance documents

An XPath-based API Standard predicates (functions) of XBRL 2.1 C-equal P-equal S-equal U-equal Duplicate-item Specific to the needs of Formula Linkbase Decimal to precision conversion

Basic processing model Formula Linkbase XBRL Instance in Process Formulas Non-deterministic order XBRL Instance out Individual formula Bind variables Input Value expression Process Create result Output XBRL Instance DTS and Formula Linkbase New Formula Processor

Formula linkbase example – Average Shares <formulaLink xlink:type="extended" xlink:role="http://www.xbrl.org/2003/role/link"> <link:loc xlink:type="locator" xlink:label="item" xlink:href="testFLconcepts.xsd#Assets"/> <formulaArc xlink:type="arc" xlink:from="item" xlink:to="formula" xlink:arcrole="http://www.xbrl.org/2004/arcrole/item-formula"/> <formula xlink:type="resource" xlink:label="formula" id="formula_2.3_AvgShares"> <variable select="co:CurrentAssets" name="CurrentAssets"/> <variable select="co:FixedAssets" name="FixedAssets" filter="flf:context-eq($this.context, $CurrentAssets.context) and flf:unit-eq($this.unit, $CurrentAssets.unit)"/> <value select="CurrentAssets.value + $FixedAssets.value"/> <result> <resultContext select="$CurrentAssets.context"/> <resultUnit select="$CurrentAssets.unit"/> </result> </formula> </formulaLink> Variables Value expression Formula Result creation

Binding variables Set up the inputs to the formula Bind to information at the XBRL abstraction level Facts (items and tuples) Contexts and Units Bind to other XML data? Filtering Absolute and relative filters Relate to other variable bindings XBRL equalities Free variables

Binding Variables <variable select="selction XPath expression" filter="filtering XPath expression" OR filterRef="filter id"/> Binding in two steps 1. Select – XPath expression, context node is <XBRL> 2. Filter – Boolean XPath expression tested on each occurrence of the “select”. <variable select="co:CurrentAssets" name="CurrentAssets"/> <variable select="co:FixedAssets" name="FixedAssets" filterRef="rf2.1"/> <filter id="rf2.1" test="$this.context is $CurrentAssets.context and flf:unit-eq($this.unit, $CurrentAssets.unit) and flf:parent-eq($fact, $CurrentAssets)"/>

Binding Variables <variable select="selction XPath expression" filter="filtering XPath expression" OR filterRef="filter id"/> Binding in two steps 1. Select – XPath expression, context node is <XBRL> 2. Filter – Boolean XPath expression tested on each occurrence of the “select”. <variable select="co:CurrentAssets" name="CurrentAssets" filter="$this.instant=‘2003-12-31’"/> <variable select="co:FixedAssets" name="FixedAssets" filterRef="rf2.1"/> <filter id="rf2.1" test="$this.context is $CurrentAssets.context and flf:unit-eq($this.unit, $CurrentAssets.unit) and flf:parent-eq($fact, $CurrentAssets)"/>

Binding variables - Filtering Absolute filters – do not rely any other XBRL variable bindings Relative filters – use other variables bindings to express a relationship between the variable being filtered and other variable bindings $this variable – The current “select” being tested in the filter. XBRL functions for filters context-eq(), unit-eq(), parent-eq(), isFact(), isItem(), isTuple() <variable select="co:CurrentAssets" name="CurrentAssets" filter="$this.instant=‘2003-12-31’"/> <variable select="co:FixedAssets" name="FixedAssets" filterRef="rf2.1"/> <filter id="rf2.1" test="$this.context is $CurrentAssets.context and flf:unit-eq($this.unit, $CurrentAssets.unit) and flf:parent-eq($fact, $CurrentAssets)"/>

Free variables Each XBRL variables creates a set of XPath variables based on what type of XBRL object is bound. Items Context Unit .value .context .period .startDate .endDate .instant .entity .identifier .segment .scheme .scenario .period .startDate .endDate .instant .entity .identifier .measure

Value expressions Cartesian product of bindings Pre-testing – boolean XPath expression Formula expression – XPath expression <value select="$CurrentAssets.value + $FixedAssets.value"/> <value test="true()" select="$Earnings.value / $Shares.value"/> <value test="$Shares" select="$Earnings.value / $Shares.value"/> <value test="$AvgShares" select="$Earnings.value / $AvgShares.value"/> <value select="fn:months-from-durations($Assets.instant - $PrevAssets.instant)"/>

Create the result Value production Context and unit production Described from inputs or constants Tuples – the problem child <result> <resultContext select="$CurrentAssets.context"/> <resultUnit select="$CurrentAssets.unit"/> </result> <resultPeriod> <resultStartDate select="$Shares.instant + P1D"/> <resultEndDate select="$SharesNext.instant"/> </resultPeriod> <resultEntity select="$Shares.entity"/> <resultScenario select="$Shares.scenario"/> <resultUnit select="$Shares.unit"/>

Formula linkbase example – Average Shares <formulaLink xlink:type="extended" xlink:role="http://www.xbrl.org/2003/role/link"> <link:loc xlink:type="locator" xlink:label="item" xlink:href="testFLconcepts.xsd#AvgShares"/> <formulaArc xlink:type="arc" xlink:from="item" xlink:to="formula" xlink:arcrole="http://www.xbrl.org/2004/arcrole/item-formula"/> <formula xlink:type="resource" xlink:label="formula" id="formula_2.3_AvgShares"> <variable select="co:Shares" name="SharesNext"/> <variable select="co:Shares" name="SharesPrev" filter="$this.period = $SharesNext.period - P1Y and flf:unit-eq($this.unit, $SharesNext.unit)"/> <value select="($SharesNext.value + $SharesPrev.value) / 2"/> <result> <resultPeriod> <resultStartDate select="$Shares.instant + P1D"/> <resultEndDate select="$SharesNext.instant"/> </resultPeriod> <resultEntity select="$SharesPrev.entity"/> <resultScenario select="$SharesPrev.scenario"/> <resultUnit select="$SharesPrev.unit"/> </result> </formula> </formulaLink> Result Item Result Item

Expressing formulas as metadata Requirements balance The formula linkbase has to find a balance between: Expressing formulas as metadata vs. Processing formulas

Demo formula processor implementation Written in XSLT – easy to create (OTSOG!!!) Transforms a formula linkbase into an XSLT stylesheet Each formula becomes a named template An instance document is the input to the generated stylesheet Output is a new valid instance document