XBRL Functions 1.0
Public Working Draft of 2006-12-07
Copyright © 2005, 2006, XBRL International Inc., All Rights Reserved
This file:
XF-PWD-2006-12-07.rtf
is Normative. All other versions and formats are non-normative.
Name |
|
Affiliation |
Chris Simmons |
DecisionSoft |
|
XBRL International Inc. |
Cliff Binstock |
cliff.binstock@coyotereporting.com |
Coyote Reporting LLC |
Phillip Engel |
Morgan Stanley |
|
Herm Fischer |
UBmatrix |
|
David vun Kannon |
david.k.vunkannon@us.pwc.com |
PricewaterhouseCoopers |
Hugh Wallis |
XBRL International Inc. |
|
Paul Warren |
DecisionSoft |
This is a Public Working Draft whose circulation is unrestricted. Comments should be directed to the editor and/or contributors by e-mail. Recipients of this draft are invited to submit, with their comments, notification of any relevant patent rights of which they are aware and to provide supporting documentation.
This specification builds on the eXtensible Business Reporting Language (XBRL) version 2.1 specification. It defines XPath 2.0 functions to aid in the querying and creation of XBRL instance documents, effectively providing an XBRL specific extension to XPath 2.0.
Terminology and formatting conventions
Entity, Segments and Scenario Constructors
create-context-from-instant-contexts
Document history (non-normative)
Intellectual Property Status (non-normative)
Appendix: Approval process (non-normative)
This specification sets out a collection of functions which operate on XBRL constructs and defines their expected behaviour. These functions act upon the schema types of XBRL, using the notation set out in the XPath and XQuery.
See http://www.w3.org/TR/xquery-semantics/#sec_content_models for details on the type system used herein and http://www.w3.org/TR/xquery-operators/#func-signatures for the notation used for specifying function signatures.
Terminology used in XBRL frequently overlaps with terminology from other fields. The terminology used in this document is summarised below.
Table 1. Terminology
Abstract element, bind, concept, concrete element, context, Discoverable Taxonomy Set (DTS), duplicate items, duplicate tuples, element, entity, equal, essence concept, fact, instance, item, least common ancestor, linkbase, period, taxonomy, tuple, unit, taxonomy schema, child, parent, sibling, grandparent, uncle, ancestor, XBRL instance, c-equal, p-equal, s-equal, u-equal, v-equal, x-equal, minimally conforming XBRL processor, fully conforming XBRL processor. |
As defined in [XBRL]. |
must, must not, required, shall, shall not, should, should not, may, optional |
See [RFC2119] for definitions of these and other terms. These include, in particular: should Conforming documents and applications are encouraged to behave as described. must Conforming documents and consuming applications are required to behave as described; otherwise they are in error. |
Binding language |
An implementation of the functions will be available in a particular programming language. This is the binding language. |
Implementation language |
The implementation language is the language in which the behaviour of the functions is implemented. This will often be the same as the binding language but this is not necessarily the case. Notably, XPath 2 functions are typically implemented in another language. |
The following highlighting is used for positive examples:
Example 1. Example of an example
|
Counterexamples indicate incorrect or unsupported examples:
Example 2. Example of a counterexample
|
Selections from other normative documents is highlighted thus:
Example 3. Example of normative material
|
Non-normative editorial comments are denoted as follows and removed from final recommendations:
CPS: This highlighting indicates editorial comments about the current draft, prefixed by the editor’s initials.
Italics are used for rhetorical emphasis only and do not convey any special normative meaning.
This document is normative in the sense that any function specification recommendations by XBRL International must satisfy the requirements as they are stated here.
This document version depends upon XBRL 2.1 Specification Recommendation.
XBRL Specification 2.1 does not depend in any way upon this document.
The official language of XBRL International’s own work products is English and the preferred spelling convention is UK English.
All bindings defined in this specification are defined in the namespace "http://www.xbrl.org/2005/function/instance". Certain namespace prefix bindings are used throughout this specification, although their use is non-normative.
Prefix |
Namespace |
xfi |
http://www.xbrl.org/2005/function/instance |
xfie |
http://www.xbrl.org/2005/function/instance/error |
xbrli |
http://www.xbrl.org/2003/instance |
link |
http://www.xbrl.org/2003/linkbase |
xl |
http://www.xbrl.org/2003/XLink |
iso4217 |
http://www.xbrl.org/2003/iso4217 |
xs |
http://www.w3.org/2001/XMLSchema |
fn |
http://www.w3.org/2004/10/xpath-functions |
xdt |
http://www.w3.org/2004/10/xpath-datatypes |
err |
http://www.w3.org/2004/10/xqt-errors |
The reference implementation of the functions described in this document can be found in the following URL:
http://www.xbrl.org/2006/functions/xf-2006.xq
Software vendors are free to use that set of functions from the web or in a local copy of that file and to provide custom implementation of that functions. The custom version of those functions MUST produce exactly the same output as the reference functions. The functions are implemented using the W3C XQuery [XQuery] language.
This specification contains examples for the use and expected outcome of applying the functions to various XBRL instances. All instances occur in the examples directory use the same simple taxonomy.
The following variables are used in examples, and refer to various elements in the given example instance document. In addition to the namespace bindings defined earlier, we define the following namespace binding for use in examples.
Prefix |
Namespace |
acme |
http://example.com/acme/results/2003-07-01 |
Example 4. Variables used in examples
Variable |
XPath expression |
$acme-instance |
doc("examples/acme-results.xbrl")/xbrli:xbrl |
$duplicates-instance |
doc("examples/duplicates.xbrl")/xbrli:xbrl |
$acme-taxonomy |
doc("examples/taxonomy/acme.xsd")/xs:schema |
$acme-taxonomy-small |
doc("examples/taxonomy/acme-small.xsd")/xs:schema |
$acme-linkbase-pres |
doc("examples/taxonomy/acme_presentation.xml")/link:linkbase/link:presentationLink |
$u1 |
$acme-instance/id("u1") |
$u2 |
$acme-instance/id("u2") |
$u4 |
$acme-instance/id("u4") |
$c1 |
$acme-instance/id("c1") |
$c2 |
$acme-instance/id("c2") |
$c3 |
$acme-instance/id("c3") |
$c1UK |
$acme-instance/id("c1UK") |
$c1US |
$acme-instance/id("c1US") |
$c1Asia |
$acme-instance/id("c1Asia") |
$totalRevenue1 |
$acme-instance/acme:totalRevenue[1] |
$totalRevenue2 |
$acme-instance/acme:totalRevenue[2] |
$totalExpenditure |
$acme-instance/acme:totalExpenditure |
$revenueByGeographicSegmentUS |
$acme-instance/acme:revenueByGeographicSegment[@contextRef="c1US"] |
$title |
$acme-instance/acme:additionalInformation/acme:title |
$duplicateItem |
$duplicates-instance/acme:totalRevenue[1] |
$duplicateTuple |
$duplicates-instance/acme:companyWebsite[1] |
Many functions are defined for accessing the various components of an XBRL instance. Their distinguishing feature is that they supply access to the various components of an XBRL instance, in a fashion that exposes their relationships.
For each standard ‘dimension’ of an item (namely the unit, period, identifier, segment and scenario), there is a corresponding function to access that dimension directly from the item. Additional functions are defined to access components from other starting points.
Items come in two distinct types, numeric and non-numeric, and it is often necessary to distinguish between them. In particular, numeric items have units and precision or decimals. Certain functions specified in this document are only defined for items that are numeric and will raise the error xfie:ItemIsNotNumeric should they be applied to non-numeric items.
xfi:is-numeric($item as schema-element(xbrli:item)) as xs:boolean
$item |
The item to test. |
Returns true if the item is of or is derived from one of the following types and false otherwise.
· xbrli:fractionItemType
· xbrli:decimalItemType
· xbrli:floatItemType
· xbrli:doubleItemType
· xbrli:monetaryItemType
· xbrli:sharesItemType
· xbrli:pureItemType
· xbrli:integerItemType
· xbrli:nonPositiveIntegerItemType
· xbrli:negativeIntegerItemType
· xbrli:longItemType
· xbrli:intItemType
· xbrli:shortItemType
· xbrli:byteItemType
· xbrli:nonNegativeIntegerItemType
· xbrli:unsignedLongItemType
· xbrli:unsignedIntItemType
· xbrli:unsignedShortItemType
· xbrli:unsignedByteItemType
· xbrli:positiveIntegerItemType
xfi:is-numeric($totalRevenue1) returns xs:boolean("true")
xfi:is-numeric($title) returns xs:boolean("false")
In the XBRL specification, Section 4.6.6, a means of inferring the precision of a fact is defined. On the basis of this, we define a precision function.
xfi:precision($item as schema-element(xbrli:item)) as xdt:anyAtomicType
$item |
The item for which to obtain the precision. |
Return the actual or the inferred precision of a numeric fact.
For non‑numeric facts, the dynamic error xfie:ItemIsNotNumeric occurs.
xfi:precision($totalRevenue1) returns xs:string("INF")
xfi:precision($totalRevenue2) returns xs:nonNegativeInteger("9")
For items, the contextRef attribute references the context of a fact and for numeric items, the unitRef attribute references the unit of a fact. Consequently, we define the following functions:
xfi:context($item as schema-element(xbrli:item)) as element(xbrli:context)
$item |
The item for which to obtain the context. |
Return the context whose id attribute value is equal to the item’s contextRef attribute value.
xfi:context($totalRevenue1) returns $c1
xfi:context($totalRevenue2) returns $c3
xfi:unit($item as schema-element(xbrli:item)) as element(xbrli:unit)?
$item |
The item for which to obtain the unit. |
Returns the unit whose id attribute value is equal to the item’s unitRef attribute value. For non-numeric items the empty sequence is returned.
xfi:unit($totalRevenue1) returns $u1
xfi:unit($totalRevenue2) returns $u2
xfi:unit($title) returns ()
To provide convenient access to the numerator and denominator of a unit, the following functions are provided:
xfi:unit-numerator($unit as element(xbrli:unit)) as element(xbrli:measure)+
$item |
The unit for which to obtain the numerator. |
Returns either the measure elements that occur as children of the unitNumerator descendant of the unit in the case where a divide element occurs; otherwise returns the measure children of the unit.
xfi:unit-numerator($u1) returns the measure iso4217:GBP
xfi:unit-numerator($u4) returns the measure iso4217:USD
xfi:unit-denominator($unit as element(xbrli:unit)) as element(xbrli:measure)*
$item |
The unit for which to obtain the denominator. |
Returns either the measure elements that occur as children of the unitDenominator descendant of the unit in the case where a divide element occurs; otherwise returns an empty list.
xfi:unit-denominator($u1) returns ()
xfi:unit-denominator($u4) returns the measure iso4217:GBP
xfi:measure-name($measure as element(xbrli:measure)) as xs:QName
$measure |
The measure for which to obtain the qualified name. |
Returns the qualified name specified by the measure.
xfi:measure-name(xfi:unit-numerator($u1)) returns the QName iso4217:GBP
Contexts are containers for periods, segments and scenarios. Functions are provided for accessing and interrogating the components of contexts.
xfi:period($item as schema-element(xbrli:item)) as element(xbrli:period)
$item |
The item. |
Return the period element of the context matching the supplied item’s contextRef attribute.
xfi:period($totalRevenue1) returns $c1/xbrli:period[1]
xfi:context-period($context as element(xbrli:context)) as element(xbrli:period)
$context |
The context. |
Return the period element of the supplied context.
xfi:context-period($c1) returns $c1/xbrli:period[1]
xfi:is-start-end-period($period as element(xbrli:period)) as xs:boolean
$period |
The period. |
Return true if the period contains a startDate and endDate style period and false otherwise.
xfi:is-start-end-period(xfi:context-period($c1)) returns xs:boolean("true")
xfi:is-start-end-period(xfi:context-period($c2)) returns xs:boolean("false")
xfi:is-forever-period($period as element(xbrli:period)) as xs:boolean
$period |
The period. |
Returns true if the period contains a forever element, and returns false otherwise.
xfi:is-forever-period(xfi:context-period($c1)) returns xs:boolean("false")
xfi:is-forever-period(xfi:context-period($c3)) returns xs:boolean("true")
xfi:is-duration-period($period as element(xbrli:period)) as xs:boolean
$period |
The period. |
Returns true if the period is a duration period (start/end or forever).
xfi:is-duration-period(xfi:context-period($c1)) returns xs:boolean("true")
xfi:is-duration-period(xfi:context-period($c2)) returns xs:boolean("false")
xfi:is-instant-period($period as element(xbrli:period)) as xs:boolean
$period |
The period. |
Returns true if the period is an instant period.
xfi:is-instant-period(xfi:context-period($c1)) returns xs:boolean("false")
xfi:is-instant-period(xfi:context-period($c2)) returns xs:boolean("true")
xfi:period-start($period as element(xbrli:period)) as xs:dateTime
For the dates, XBRL uses a union of date and dateTime. When a date is specified, it should be expanded to a dateTime as specified in Section 4.7.2 of the XBRL specification. Note that this expansion differs for beginning and period ends.
$period |
The period. |
Return The period start dateTime for start-end periods (satisfying xfi:is-start-end-period($period) ), the instant for instants (satisfying xfi:is-instant-period($period) ), or xfie:PeriodIsForever is raised (if xfi:is-forever-period($period)).
xfi:period-start(xfi:context-period($c1)) returns xs:dateTime("2004‑03‑31T00:00:00")
xfi:period-start(xfi:context-period($c2)) returns xs:dateTime("2004‑11‑18T00:00:00")
xfi:period-start(xfi:context-period($c3)) raises error xfie:PeriodIsForever
xfi:period-end($period as element(xbrli:period)) as xs:dateTime
$period |
The period |
Return the period end dateTime for start-end periods, the instant for instants, and the dynamic error xfie:PeriodIsForever for forever periods. If the value in the instance is just an xs:date (so not an xs:dateTime) the returning value is augmented in one day to represent the last instant of that period.
xfi:period-end(xfi:context-period($c1)) returns xs:dateTime("2005‑03‑31T00:00:00")
xfi:period-end(xfi:context-period($c2)) returns xs:dateTime("2004‑11‑19T00:00:00")
xfi:period-end(xfi:context-period($c3)) raises error xfie:PeriodIsForever
xfi:period-instant($period as element(xbrli:period)) as xs:dateTime
$period |
The period, |
Returns the period instant date-time or the dynamic error xfie:PeriodIsNotInstant is raised if period is not instant.
xfi:period-instant(xfi:context-period($c1)) raises error xfie:PeriodIsNotInstant
xfi:period-instant(xfi:context-period($c2)) returns xs:dateTime("2004-11-19T00:00:00")
xfi:period-instant(xfi:context-period($c3)) raises error xfie:PeriodIsNotInstant
xfi:entity($item as schema-element(xbrli:item)) as element(xbrli:entity)
$item |
The item. |
Returns the entity of the context of the given item.
xfi:entity($totalRevenue1) returns $c1/xbrli:entity
xfi:context-entity($context as element(xbrli:context)) as element(xbrli:entity)
$context |
The context. |
Returns the entity of the context.
xfi:context-entity($c1Asia) returns $c1Asia/xbrli:entity
xfi:identifier($item as schema-element(xbrli:item)) as element(xbrli:identifier)
$item |
The item. |
Returns the identifier element associated with the given item.
xfi:identifier($totalRevenue1) returns $c1/xbrli:entity/xbrli:identifier
xfi:context-identifier($context as element(xbrli:context)) as element(xbrli:identifier)
$context |
The context. |
Returns the identifier element associated with the given context.
xfi:context-identifier($c1) returns $c1/xbrli:entity/xbrli:identifier
xfi:entity-identifier($entity as element(xbrli:entity)) as element(xbrli:identifier)
$entity |
The entity. |
Returns the identifier element associated with the given entity.
xfi:entity-identifier($c1/xbrli:entity) returns $c1/xbrli:entity/xbrli:identifier
identifier-value
xfi:identifier-value($identifier as element(xbrli:identifier)) as xs:token
$identifier |
The identifier. |
Returns the value of the identifier token.
xfi:identifier-value($c1Asia/xbrli:entity/xbrli:identifier) returns xs:token("Acme")
xfi:identifier-scheme($identifier as element(xbrli:identifier)) as xs:anyURI
$identifier |
The identifier. |
Return the value of the scheme attribute of the identifier of the entity.
xfi:identifier-scheme($c1Asia/xbrli:entity/xbrli:identifier) returns xs:anyURI("http://example.com/acme/results")
xfi:segment($item as schema-element(xbrli:item)) as element(xbrli:segment)?
$item |
The item. |
Return the segment of the given item if present and an empty sequence otherwise.
xfi:segment($revenueByGeographicSegmentUS) returns $c1US/xbrli:entity/xbrli:segment
xfi:entity-segment($entity as element(xbrli:entity)) as element(xbrli:segment)?
$entity |
The entity containing the segment. |
Return the segment content of the given entity if present and an empty sequence otherwise.
xfi:entity-segment($c1Asia/xbrli:entity) returns ""$c1Asia/xbrli:entity/xbrli:segment
xfi:context-segment($context as element(xbrli:context)) as element(xbrli:segment)?
$context |
The context. |
Return the segment content of the given context if present and an empty sequence otherwise.
xfi:context-segment($c1Asia) returns $c1Asia/xbrli:entity/xbrli:segment
xfi:scenario($item as schema-element(xbrli:item)) as element(xbrli:scenario)?
$item |
The item. |
Return the scenario of the given item if present and an empty sequence otherwise.
xfi:scenario($totalRevenue2) returns $c3/xbrli:scenario
xfi:context-scenario($context as element(xbrli:context)) as element(xbrli:scenario)?
$context |
The context. |
Return the scenario content of the given context if present and an empty sequence otherwise.
xfi:context-scenario($c3) returns $c3/xbrli:scenario
xfi:items-in-instance($instance as element(xbrli:xbrl)) as schema-element(xbrli:item)*
$instance |
Instance document |
Return a sequence of facts that are direct children of the main xbrli:xbrl element.
xfi:items-in-instance($duplicates-instance)
returns
<acme:totalRevenue decimals="2" contextRef="c3" unitRef="u1"
>9832000</acme:totalRevenue>
<acme:totalRevenue decimals="2" contextRef="c3" unitRef="u1"
>9879000</acme:totalRevenue>$c3/xbrli:scenario
xfi:tuples-in-instance($instance as element(xbrli:xbrl)) as schema-element(xbrli:tuple)*
$instance |
Instance document |
Return a sequence of tuples that are direct children of the main xbrli:xbrl element.
xfi:tuples-in-instance($duplicates-instance)
returns
$acme-instance/acme:additionalInformation
xfi:items-in-tuple($tuple as schema-element(xbrli:tuple)) as schema-element(xbrli:item)*
$tuple |
Container tuple |
Return a sequence of facts that are direct children of the $tuple element.
xfi:items-in-tuple($acme-instance/acme:additionalInformation)
returns a sequence with
( $acme-instance/acme:additionalInformation/acme:title,
$acme-instance/acme:additionalInformation/acme:author,
$acme-instance/acme:additionalInformation/acme:description )
xfi:tuples-in-tuple($tuple as schema-element(xbrli:tuple)) as schema-element(xbrli:tuple)*
$tuple |
Container tuple |
Return a sequence of tuples that are children of the $tuple parameter.
xfi:tuples-in-tuple($acme-instance/acme:additionalInformation)
returns a sequence with
( $acme-instance/acme:additionalInformation/acme:title,
$acme-instance/acme:additionalInformation/acme:author,
$acme-instance/acme:additionalInformation/acme:description )
Various predicates applicable to XBRL instances are defined in the XBRL 2.1 specification, Section 4.10. Bindings for these functions are defined in this specification. Specifically, these functions are s-equal, u-equal, v-equal, p-equal, c-equal and duplicate.
xfi:identical-nodes($left as node()*, $right as node()*) as xs:boolean
$left |
The first node to compare. |
$right |
The second node to compare. |
Return the value as an xs:boolean of evaluating the identical node comparison on the list of node lists (or individual nodes).
xfi:identical-nodes($u1, $u2) returns xs:boolean("false")
xfi:identical-nodes($u1/xbrli:measure,$u2/xbrli:measure) returns xs:boolean("false")
xfi:identical-nodes($c1, $c1) returns xs:boolean("true")
xfi:identical-nodes(($c1,$c2),($c2,$c1)) returns("false")
xfi:identical-nodes(($c1,$c2),($c1,$c2)) returns("true")
xfi:s-equal($left as node()*, $right as node()*) as xs:boolean
$left |
The first node to compare. |
$right |
The second node to compare. |
Return the value as an xs:boolean of evaluating the s-equal predicate on the list of node lists (or individual nodes).
xfi:s-equal($u1, $u2) returns xs:boolean("false")
xfi:s-equal($u1/xbrli:measure,$u2/xbrli:measure) returns xs:boolean("true")
xfi:s-equal($c1, $c2) returns xs:boolean("false")
xfi:u-equal($left as node()*, $right as node()*) as xs:boolean
$left |
Sequence of items to compare. |
$right |
Sequence of items to compare with. |
Returns the value as an xs:boolean of evaluating the u-equal predicate for the supplied items.
For elements not derived from xbrli:item the dynamic error xfie:NodeIsNotXbrlItem MUST be raised.
xfi:u-equal($totalRevenue1, $totalExpenditure) returns xs:boolean("true")
xfi:u-equal($totalRevenue2, $revenueByGeographicSegmentUS) returns xs:boolean("false")
xfi:v-equal($left as node()*, $right as node()*) as xs:boolean
$left |
Sequence of items to compare. |
$right |
Sequence of items to compare with. |
Returns the value as an xs:boolean of evaluating the v-equal predicate for the supplied items.
For elements not derived from xbrli:item the dynamic error xfie:NodeIsNotXbrlItem MUST be raised.
xfi:v-equal($totalExpenditure, $revenueByGeographicSegmentUS) returns xs:boolean("false")
xfi:c-equal($left as node()*, $right as node()*) as xs:boolean
$left |
Sequence of items to compare. |
$right |
Sequence of items to compare with. |
Returns the value as an xs:boolean of evaluating the c-equal predicate for the supplied items.
For elements not derived from xbrli:item the dynamic error xfie:NodeIsNotXbrlItem MUST be raised.
xfi:c-equal($totalExpenditure, $title) returns xs:boolean("false").
xfi:c-equal($totalExpenditure, $totalRevenue1) returns xs:boolean("true").
xfi:identical-node-set($left as node()*, $right as node()*) as xs:boolean
$left |
Sequence of items to compare. |
$right |
Sequence of items to compare with. |
Returns the value as an xs:boolean of evaluating the identical-nodes comparison over a set of nodes.
xfi:identical-node-set(($c1,$c2),($c2,$c1)) returns("true")
xfi:identical-node-set(($c1,$c2),($c1,$c2)) returns("true")
xfi:identical-node-set(($c1,$u1),($u1,$c1)) returns("true")
xfi:identical-node-set(($c1,$u2),($u1,$c1)) returns("false")
xfi:s-equal-set($left as node()*, $right as node()*) as xs:boolean
$left |
Sequence of items to compare. |
$right |
Sequence of items to compare with. |
Returns the value as an xs:boolean of evaluating the s-equal predicate for the supplied set of items.
xfi:v-equal-set($left as node()*, $right as node()*) as xs:boolean
$left |
Sequence of items to compare. |
$right |
Sequence of items to compare with. |
Returns the value as an xs:boolean of evaluating the v-equal predicate for the supplied set of items.
For elements not derived from xbrli:item the dynamic error xfie:NodeIsNotXbrlItem MUST be raised.
xfi:s-equal-set($left as node()*, $right as node()*) as xs:boolean
$left |
Sequence of items to compare. |
$right |
Sequence of items to compare with. |
Returns the value as an xs:boolean of evaluating the c-equal predicate for the supplied set of items.
For elements not derived from xbrli:item the dynamic error xfie:NodeIsNotXbrlItem MUST be raised.
xfi:u-equal-set($left as node()*, $right as node()*) as xs:boolean
$left |
Sequence of items to compare. |
$right |
Sequence of items to compare with. |
Returns the value as an xs:boolean of evaluating the u-equal predicate for the supplied set of items.
For elements not derived from xbrli:item the dynamic error xfie:NodeIsNotXbrlItem MUST be raised.
xfi:c-equal($left as node()*, $right as node()*) as xs:boolean
$left |
Sequence of items to compare. |
$right |
Sequence of items to compare with. |
Returns the value as an xs:boolean of evaluating the x-equal predicate for the supplied items.
xfi:duplicate-item($left as schema-element(xbrli:item), $right as schema-element(xbrli:item)) as xs:boolean
$left |
The first item to compare. |
$right |
The second item to compare. |
Returns true for items that are duplicates, return false otherwise.
xfi:duplicate-item($duplicateItem, $duplicateItem) returns xs:boolean("false")
xfi:duplicate-tuple($left as schema-element(xbrli:tuple), $right as schema-element(xbrli:tuple)) as xs:boolean
$left |
The first tuple to compare. |
$right |
The second tuple to compare. |
Returns true for tuples that are duplicates, returns false otherwise.
xfi:duplicate-tuple($duplicateTuple, $duplicateTuple) returns xs:boolean("false")
xfi:p-equal($left as element(), $right as element()) as xs:boolean
$left |
The first fact or tuple to compare. |
$right |
The second fact or tuple to compare with. |
Returns true for facts that are p-equal, returns false otherwise.
xfi:p-equal($totalExpenditure, $revenueByGeographicSegmentUS) returns xs:boolean("true")
xfi:p-equal($totalExpenditure, $title) returns xs:boolean("false")
xfi:cu-equal($left as node()*, $right as node()*) as xs:boolean
For elements not derived from xbrli:item the dynamic error xfie:NodeIsNotXbrlItem MUST be raised.
$left |
The first fact to compare. |
$right |
The second fact to compare. |
Returns true for facts that are both c-equal and u-equal, returns false otherwise.
xfi:cu-equal($totalExpenditure, $totalRevenue1) returns xs:boolean("true")
xfi:cu-equal($totalExpenditure, $revenueByGeographicSegmentUS) returns xs:boolean("false")
xfi:cu-equal($title, $title) returns xs:boolean("true")
xfi:cu-equal($title, $totalExpenditure) returns xs:boolean("false")
xfi:pc-equal($left as node()*, $right as node()*) as xs:boolean
For elements not derived from xbrli:item the dynamic error xfie:NodeIsNotXbrlItem MUST be raised.
$left |
The first fact to compare. |
$right |
The second fact to compare. |
Returns true for facts that are both c-equal and p-equal, returns false otherwise.
xfi:pc-equal($totalExpenditure, $totalRevenue1) returns xs:boolean("true")
xfi:pc-equal($totalExpenditure, $tittle) returns xs:boolean("false")
xfi:pcu-equal($left as node()*, $right as node()*) as xs:boolean
$left |
The first fact to compare. |
$right |
The second fact to compare. |
Returns true for facts that are both c-equal and u-equal and p-equal, returns false otherwise.
For elements not derived from xbrli:item the dynamic error xfie:NodeIsNotXbrlItem MUST be raised.
xfi:pcu-equal($totalExpenditure, $totalRevenue1) returns xs:boolean("true")
xfi:pcu-equal($totalExpenditure, $revenueByGeographicSegmentUS) returns xs:boolean("false")
xfi:pcu-equal($title, $title) returns xs:boolean("true")
xfi:pcu-equal($title, $totalExpenditure) returns xs:boolean("false")
Whereas the accessor functions give access to the various components of existing XBRL constructs a constructor function is a means of creating a new element.
Constructor functions are defined for all XML Schema built-in types in http://www.w3.org/TR/xquery-operators/#func-signatures.
The constructor functions specified herein allow the creation of new elements in an XBRL-specific fashion.
WcH: All constructors need to be able to specify any other attribute that the content model allows.
WcH: Perhaps $id should be a distinguished argument here instead of just one of the $attrs.
In order to create items, the following functions are defined.
xfi:create-numeric-item-precision($name as xs:QName, $taxonomies as xs:anyURI*, $value as xdt:untypedAtomic, $context as element(xbrli:context), $unit as element(xbrli:unit), $precision as xbrli:precisionType, $attrs as attribute()*) as schema-element(xbrli:item)
$name |
The qualified name of the numeric item to create. |
$taxonomies |
URIs of the taxonomies in one of which $name is defined. |
$value |
The value that the new item should contain. |
$context |
The context of the new item. |
$unit |
The unit of the new item. |
$precision |
The precision of the item. |
$attrs |
Additional user-supplied attributes. |
This creates a numeric item with the given name. The item has the specified precision. If the name is not resolved to appropriate element which is substitutionGroup of xbrli:item and its type is numeric, dynamic error xfie:QNameIsNotNumericItem occur. If value is not valid against the item type resolved from name, dynamic error xfie:InvalidValue occur. If context does not match item’s period type, dynamic error xfie:MismatchingContextApplied occur. If unit does not match item’s unit restriction, dynamic error xfie:MismatchingUnitApplied occur.
xfi:create-numeric-item-precision(QName("http://example.com/acme/results/2003-07-01","acme:totalRevenue"),xs:anyURI("examples/taxonomy/acme.xsd"),"5234700", $c1,$u1,"INF",())
returns a copy of $totalRevenue1
xfi:create-numeric-item-decimals($name as xs:QName, $taxonomies as xs:anyURI*, $value as xs:anyType, $context as element(xbrli:context), $unit as element(xbrli:unit), $decimals as xbrli:decimalsType, $attrs as attribute()*) as schema-element(xbrli:item)
$name |
The qualified name of the numeric item to create. |
$taxonomies |
URIs of the taxonomies in one of which $name is defined. |
$value |
The value that the new item should contain. |
$context |
The context of the new item. |
$unit |
The unit of the new item. |
$decimals |
The decimal places. |
$attrs |
Additional user-supplied attributes. |
This creates a numeric item with the given name. The behaviour is as per create-numeric-item-precision except that the new element has the supplied decimals rather than precision. If the name is not resolved to appropriate element which is substitutionGroup of xbrli:item and its type is numeric, dynamic error xfie:QNameIsNotNumericItem occur. If value is not valid against the item type resolved from name, dynamic error xfie:InvalidValue occur. If context does not match item’s period type, dynamic error xfie:MismatchingContextApplied occur. If unit does not match item’s unit restriction, dynamic error xfie:MismatchingUnitApplied occur.
xfi:create-numeric-item-decimals( QName("http://example.com/acme/results/2003-07-01","acme:totalRevenue"),xs:anyURI("examples/taxonomy/acme.xsd"),"9832000", $c3,$u2,2, ())
returns a copy of $totalRevenue2
xfi:create-non-numeric-item($name as xs:QName, $taxonomies as xs:anyURI*, $value as xs:anyType, $context as element(xbrli:context), $attrs as attribute()*) as schema-element(xbrli:item)
$name |
The qualified name of the numeric item to create. |
$taxonomies |
URIs of the taxonomies in one of which $name is defined. |
$value |
The value that the new item should contain. WcH: If $value is xs:anyType that leaves the question of how the value would be formatted. Would it not be better to make $value an xs:string ? |
$context |
The context of the new item. |
$attrs |
Additional user-supplied attributes. |
This returns a non-numeric item with the given name. If the name is not resolved to appropriate element which is substitutionGroup of xbrli:item and its type is numeric, dynamic error xfie:QNameIsNotNonNumericItem occur. If value is not valid against the item type resolved from name, dynamic error xfie:InvalidValue occur. If context does not match item’s period type, dynamic error xfie:MismatchingContextApplied occur.
xfi:create-non-numeric-item( QName("http://example.com/acme/results/2003-07-01","acme:title"),xs:anyURI("examples/taxonomy/acme.xsd"),"Acme results for the third quarter 2002",$c2, ())
returns a copy of $title
WcH: Nil items can be either numeric or non-numeric, so this function probably shouldn’t exist at all, rather there should be a Boolean $nil argument of create-{non-}numeric-item functions.
xfi:create-nil-item($name as xs:QName, $taxonomies as xs:anyURI*, $context as element(xbrli:context) , $attrs as attribute()*) as schema-element(xbrli:item)
xfi:create-nil-item($name as xs:QName, $taxonomies as xs:anyURI*, $context as element(xbrli:context), $unit as element(xbrli:unit) , $attrs as attribute()*) as schema-element(xbrli:item)
$name |
The name of the item. |
$taxonomies |
URIs of the taxonomies in one of which $name is defined. |
$context |
The context of the item. |
$unit |
The unit of the item, required for numeric items. |
$attrs |
Additional user-supplied attributes. |
This returns a nil item (that is, with the attribute xsi:nil="true") and with the given name and context. The version that takes a unit is to be used for numeric items. If the name is not resolved to appropriate element which is substitutionGroup of xbrli:item, dynamic error xfie:QNameIsNotItem occur. If context does not match item’s period type, dynamic error xfie:MismatchingContextApplied occur. If unit does not match item’s unit restriction, dynamic error xfie:MismatchingUnitApplied occur.
DVK: What we really need to do is match the XML Schema content model exactly, including the possibility of attributes from other namespaces.
xfi:create-nil-item(QName("http://example.com/acme/results/2003-07-01","acme:title"),xs:anyURI("examples/taxonomy/acme.xsd"),$c2,())
returns the element "<acme:title xsi:nil="true" contextRef="c2" />"
It is necessary to create a tuple, either from the existing items and tuples or from the content of an existing XBRL instance.
xfi:create-tuple($name as xs:QName, $taxonomies as xs:anyURI*, $facts as element()* , $attrs as attribute()*) as schema-element(xbrli:tuple)
$name |
The name for the new tuple. |
$taxonomies |
URIs of the taxonomies in one of which $name is defined. |
$facts |
The list of child facts that the new tuple must contain. |
$attrs |
Additional user-supplied attributes. |
Returns the newly created tuple that must contain the child facts in the order specified, with the given name. If the name is not resolved to appropriate element which is substitutionGroup of xbrli:tuple, dynamic error xfie:QNameIsNotTuple occur. If facts are not valid against the tuple content type, dynamic error xfie:InvalidContentType occur.
xfi:create-tuple(QName("http://example.com/acme/results/2003-07-01","acme:companyWebsite"),xs:anyURI("examples/taxonomy/acme.xsd"),(),()) returns "<acme:companyWebsite />"
Included are functions for creating contexts and their sub-elements. Contexts may be created from scratch and by copying existing contexts or their sub-components.
In XBRL there are three kinds of periods – forever, instants and start/end periods. A different constructor function is supplied for each kind of period. Create-period is polymorphic.
xfi:create-period() as element(xbrli:period)
No parameters. Return a forever period.
xfi:create-period() returns the element "<period><forever/></period>"
xfi:create-period-date($instant as xs:date) as element(xbrli:period)
xfi:create-period-dateTime($instant as xs:dateTime) as element(xbrli:period)
$instant |
The date or date time for the new instant. |
Return a new instant period with the given date.
xfi:create-period-date(xs:date("1958-10-19")) returns the element "<period><instant>1958‑10‑19</instant></period>"
xfi:create-period-date($start as xs:date, $end as xs:date) as element(xbrli:period)
xfi:create-period-dateTime($start as xs:dateTime, $end as xs:dateTime) as element(xbrli:period)
$start |
The start date or date time. |
$end |
The end date or date time. |
Return a new start/end date style period. The start date must occur before the end date or else the dynamic error xfie:StartDateNotPrecedingEndDate occurs.
xfi:create-period-date(xs:date("1958-10-19"),xs:date("2000-04-04")) returns the element
<period>
<startDate>1958‑10‑19</startDate>
<endDate>2000‑04‑04</endDate>
</period>
The segments and scenarios are supplied as lists of nodes since in general they are simply containers for freeform XML. A constructor function is supplied for creating entities.
xfi:create-entity($identifier as xs:token, $scheme as xs:anyURI, $segment as node()*) as element(xbrli:entity)
$identifier |
The entity identifier. |
$scheme |
The entity identifier scheme. |
$segment |
The nodes to appear in the segment. |
This function creates a new entity element from scratch using the supplied data.
xfi:create-entity(xs:token("example.com"),xs:anyURI("http://nic.net"),()) returns the element
<entity>
<identifier scheme="http://nic.net">example.com</identifier>
</entity>
New contexts may be created either directly from their constituent parts (periods and entities for example) or based on existing contexts.
xfi:create-context($period as element(xbrli:period), $entity as element(xbrli:entity), $scenario as node()*, $id as xs:string) as element(xbrli:context)
$period |
The period of the new context. |
$entity |
The entity of the new context. |
$scenario |
The scenario of the new context. |
$id |
The id of the new context. |
Returns a new context constructed from the various constituent elements in a context.
xfi:create-context(xfi:context-period($c1),xfi:context-entity($c1),xfi:context-scenario($c1),$c1/@id)
returns a copy of $c1
xfi:create-start-instant-context($context as element(xbrli:context), $id as xs:string) as element(xbrli:context)
$context |
The base context. |
$id |
The id of the new context. |
Creates a new context equivalent to the supplied context (which must have a start-end date style period, or else the dynamic error xfie:PeriodIsForever or the dynamic error xfie:PeriodIsNotStartEnd is raised) except that the period is an instant equal to the value of ‘xfi:period‑start($context)’
xfi:create-start-instant-context($c1,"c1start") returns the element
<context id="c1start">
<entity>
<identifier scheme="http://example.com/acme/results">Acme</identifier>
</entity>
<period>
<instant>2004-03-31T00:00:00</instant>
</period>
</context>
xfi:create-end-instant-context($context as element(xbrli:context), $id as xs:string) as element(xbrli:context)
$context |
The base context. |
$id |
The id of the new context. |
As per xfi:create-start-instant-context, except that the instant takes the value of ‘period-end($context)’.
xfi:create-end-instant-context($c1,"c1end") returns the element
<context id="c1end">
<entity>
<identifier scheme="http://example.com/acme/results">Acme</identifier>
</entity>
<period>
<instant>2005-03-30T00:00:00</instant>
</period>
</context>
xfi:create-context-from-instant-contexts($left as element(xbrli:context), $right as element(xbrli:context), $id as xs:string) as element(xbrli:context)
$left |
The first context, which must be an instant. |
$right |
The second context, which must be an instant. |
$id |
The id for the new context. |
Returns a duration (start-end style) context starting from xfi:period‑instant($left) and ending on xfi:period‑instant($right).
If either of the contexts is not an instant, then the dynamic error xfie:PeriodIsNotInstant is raised. If the entities (and the respective scenarios) of the contexts are not s-equal, then the dynamic error xfie:InconsistentContexts occurs.
If the first instant is not before the second instant, then the dynamic error xfie:StartDateNotPrecedingEndDate occurs.
xfi:create-context-from-instant-contexts(fi:create-start-instant-context($c1,"cx"), $c2, "c1end")
Return the element
<context id="c1end">
<entity>
<identifier scheme="http://example.com/acme">Acme</identifier>
</entity>
<period>
<startDate>2004-03-31T00:00:00</startDate>
<endDate>2004-11-18T00:00:00</endDate>
</period>
</context>
xfi:create-context-from-instant-contexts($c2, fi:create-start-instant-context($c1,"cx"),"c1end") raises error xfie:StartDateNotPrecedingEndDate
As well as functions for creating new units, there are additionally functions for performing ‘unit arithmetic’, in the sense of multiplying and inverting units. These allow the automatic computation of the units of a calculation.
Note that the measure for the QName xbrli:pure must be treated as a multiplicative identity so that for any measure $measure:
<measure>xbrli:pure</measure> * $measure = $measure = $measure * <measure>xbrli:pure</measure>
xfi:create-unit($numerator as xs:QName+, $denominator as xs:QName*, $id as xs:string) as element(xbrli:unit)
$numerator |
The non-empty list of measure QNames to appear as numerators or as children of the unit. |
$denominator |
The list of denominator measure QNames. |
$id |
The id for the new unit. |
Return a new unit using the supplied numerator and denominator with the given id. If the denominator is empty, then no divide element occurs and the measures are direct children of the new unit. Otherwise, a divide element occurs and the numerator measures occur as children of the unitNumerator element, whilst the denominator measures occur as children of the unitDenominator element. The resulting measure should be in its simplest form, as per XBRL specification Section 4.8.4. In particular, any cancellable measures should be eliminated and pure units should be reduced.
xfi:create-unit(
QName("http://www.xbrl.org/2003/iso4217","iso4217:USD"),
QName("http://www.xbrl.org/2003/instance","xbrli:shares"),
"usdPerShare") returns
<unit id="usdPerShare">
<divide>
<unitNumerator>
<measure xmlns:iso4217="http://www.xbrl.org/2003/iso4217">iso4217:USD</measure>
</unitNumerator>
<unitDenominator>
<measure xmlns:xbrli="http://www.xbrl.org/2003/instance">xbrli:shares</measure>
</unitDenominator>
</divide>
</unit>
xfi:create-unit(
(QName("http://www.xbrl.org/2003/iso4217","iso4217:USD"),
QName("http://www.xbrl.org/2003/instance","xbrli:pure",
QName("http://www.xbrl.org/2003/instance","xbrli:decimal"), (QName("http://www.xbrl.org/2003/instance","xbrli:decimal",
QName("http://www.xbrl.org/2003/instance","xbrli:shares"),
"usdPerShare") returns
<unit id="usdPerShare">
<divide>
<unitNumerator>
<measure xmlns:iso4217="http://www.xbrl.org/2003/iso4217">iso4217:USD</measure>
</unitNumerator>
<unitDenominator>
<measure xmlns:xbrli="http://www.xbrl.org/2003/instance">xbrli:shares</measure>
</unitDenominator>
</divide>
</unit>
xfi:create-product-unit($units as element(xbrli:unit)*, $id as xs:string) as element(xbrli:unit)
$units |
The list of units. |
$id |
An id for the new unit. |
Return a new unit which is the product of the supplied unit arguments using the given id.
If the list is empty then the pure unit is used (that is, a unit with an empty denominator and a numerator consisting of a single measure xbrli:pure).
xfi:create-product-unit((),"u") return
<unit id="u">
<measure>pure</measure>
</unit>
xfi:create-product-unit(
(create-unit(
QName("http://www.xbrl.org/2003/iso4217","iso4217:USD"),(),"void"),
create-unit(
QName("http://www.xbrl.org/2003/instance","xbrli:pure"),(),"void")
)
,"u") return
<unit id="u">
<measure xmlns:iso4217="http://www.xbrl.org/2003/iso4217">iso4217:USD</measure>
</unit>
xfi:create-product-unit(
(create-unit(
QName("http://www.xbrl.org/2003/iso4217","iso4217:USD"),(),"void"),
create-unit(
QName("http://www.xbrl.org/2003/iso4217","iso4217:USD"),(),"void")
)
,"u") return
<unit id="u">
<measure xmlns:iso4217="http://www.xbrl.org/2003/iso4217">iso4217:USD</measure>
<measure xmlns:iso4217="http://www.xbrl.org/2003/iso4217">iso4217:USD</measure>
</unit>
xfi:create-inverse-unit($unit as element(xbrli:unit), $id as xs:string) as element(xbrli:unit)
$unit |
The unit to invert. |
$id |
An id for the new unit. |
Return a new unit that is the inverse of the supplied unit using the given id. Note that the inverse of the pure measure is again the pure measure.
xfi:create-inverse-unit(xfi:create-unit(
QName("http://www.xbrl.org/2003/instance","xbrli:pure"),(),"p"), "p")
return
<unit id="p">
<measure xmlns:xbrli="http://www.xbrl.org/2003/instance">xbrli:pure</measure>
</unit>
xfi:create-inverse-unit(
<xbrli:unit id="uid">
<xbrli:divide xmlns:iso4217="http://www.xbrl.org/2003/iso4217">
<xbrli:unitNumerator>
<xbrli:measure>iso4217:USD</xbrli:measure>
</xbrli:unitNumerator>
<xbrli:unitDenominator>
<xbrli:measure>shares</xbrli:measure>
</xbrli:unitDenominator>
</xbrli:divide>
</xbrli:unit>
, "p")
return
<xbrli:unit id="p">
<xbrli:divide xmlns:iso4217="http://www.xbrl.org/2003/iso4217">
<xbrli:unitNumerator>
<xbrli:measure>shares</xbrli:measure>
</xbrli:unitNumerator>
<xbrli:unitDenominator>
<xbrli:measure>iso4217:USD</xbrli:measure>
</xbrli:unitDenominator>
</xbrli:divide>
</xbrli:unit>
A user will need to assemble various components into complete XBRL instances. In order to perform this, the following functions are supplied.
Firstly, it will be necessary on occasion to explicitly add schemaRef and linkbaseRef elements as necessary to the XBRL instance.
xfi:create-schemaRef($location as xs:anyURI) as element(link:schemaRef)
$location |
The URI reference of the schema to be referenced. |
Returns a new link:schemaRef with xlink:href equal to the supplied URI.
xfi:create-schema-ref(xs:anyURI("taxonomy/acme.xsd)) returns
<link:schemaRef xlink:type="simple" xlink:href="taxonomy/acme.xsd"/>
xfi:create-linkbaseRef($location as xs:anyURI,$role as xs:anyURI) as element(link:linkbaseRef)
$location |
The URI reference of the linkbase to be referenced. |
$role |
The optional role of the linkbaseRef |
Returns a new link:linkbaseRef with xlink:href equal to the supplied URI and role, if supplied.
xfi:create-linkbaseRef(xs:anyURI("my-2005-04-31.xml"), xs:anyURI("http://wwwx.xbrl.org/2003/role/presentationLinkbaseRef")) returns
<link:linkbaseRef xlink:href="my-2005-04-31.xml" xlink:type="simple" xlink:role="http://wwwx.xbrl.org/2003/role/presentationLinkbaseRef" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase"/>
xfi:create‑instance($refs as schema-element(xl:simple)+, $contexts as element(xbrli:context)*, $units as element(xbrli:unit)* , $facts as element()*, $footnotes as element(link:footnoteLink)*) as document-node(element(xbrli:xbrl))
$refs |
The list of references to appear at the start of the new instance. This must include at least one link:schemaRef element. Note that the linkbase references will appear in the order specified. |
$contexts |
The list of contexts the new instance should contain. |
$units |
The list of units the new instance should contain. |
$facts |
The list of facts to appear as children of the new instance. |
$footnotes |
The sequence of footnote links the new instance should contain. |
Return a new instance containing the supplied facts, contexts, units and footnotes. The output instance document MUST be validated against the http://www.xbrl.org/2003/instance schema but may not be a valid XBRL document if validated against the XBRL specification.
xfi:create‑instance(xfi:create-schemaRef(xs:anyURI("my-2006-12-07.xsd")),(),(),(),()) returns an empty instance.
Footnotes can be created dynamically and added to an instance document as a parameter to the create-instance function. Te following functions helps in the creation of the link:footnoteLink element, footnote resources, arcs and locators.
xfi:create-footnoteLink($role as xs:anyURI, $footnotes as schema-element(link:footnote)+, $footnoteLocs as schema-element(xl:locator)+, $footnoteArcs as schema-element(xl:arc)+) as element(link:footnoteLink)
$role |
The content of the xlink:role attribute |
$footnotes |
Footnote resources that will be included as content of the link:footnoteLink element. |
$footnoteLocs |
Locators to facts. |
$footnoteArcs |
Arcs connecting the resources to the locators. |
Return a link:footnoteLink element with the corresponding content.
xfi:create-footnoteLink(
xs:anyURI(/"http://www.xbrl.org/2003/role/link"),
xfi:create-footnote(
xs:NCName("res_note"),
xs:anyURI("http://www.xbrl.org/2003/role/footnote"),
xs:language("en"),(),"Text of the note1"
),
(
xfi:create-loc(xs:anyURI("#note1"),xs:NCName("loc_notes1and2")),
xfi:create-loc(xs:anyURI("#note2"),xs:NCName("loc_notes1and2"))
),
xfi:create-footnoteArc(
xs:NCName("loc_notes1and2"),
xs:NCName("res_note"),
xs:anyURI("http://www.xbrl.org/2003/arcrole/fact-footnote"),
()
)
)
returns
<link:footnoteLink xlink:role="http://www.xbrl.org/2003/role/link" xlink:type="extended">
<link:footnote xlink:type="resource" xlink:label="res_note" xlink:role="http://www.xbrl.org/2003/role/footnote" xml:lang="en">Text of the note1</link:footnote>
<link:loc xlink:type="locator" xlink:href="#note1" xlink:label="loc_notes1and2"/>
<link:loc xlink:type="locator" xlink:href="#note2" xlink:label="loc_notes1and2"/>
<link:footnoteArc xlink:type="arc" xlink:to="res_note" xlink:from="loc_notes1and2" xlink:arcrole="http://www.xbrl.org/2003/arcrole/fact-footnote"/>
</link:footnoteLink>
xfi:create-footnote($label as xs:NCName, $role as xs:anyURI, $lang as xs:language, $attrs as attribute()*, $note as xs:string) as element(link:footnote)
$label |
The resource label. |
$role |
The value of the xlink:role attribute. |
$lang |
The value of the xml:lang attribute. |
$attrs |
Additional attributes if required. |
$note |
The content of the footnote. |
Return a link:footnote resource.
xfi:create-footnote(
xs:NCName("res_note1"),
xs:anyURI("http://www.xbrl.org/2003/role/footnote"),
xs:language("en"),
(),
"Aditional note for the note1"
)
returns
<link:footnote xlink:type="resource" xlink:label="res_note1" xlink:role="http://www.xbrl.org/2003/role/footnote" xml:lang="en">Aditional note for the note1</link:footnote>
xfi:create-loc($href as xs:anyURI, $label as xs:NCName) as element(link:loc)
$href |
The value of the xlink:href attribute. |
$label |
The locator label. |
Return a link:loc element. This is a generic function to create locators.
xfi:create-loc(xs:anyURI("#note1"),xs:NCName("loc_note1"))
returns
<link:loc xlink:type="locator" xlink:href="#note1" xlink:label="loc_note1"/>
xfi:create-footnoteArc($from as xs:NCName, $to as xs:NCName, $arcrole as xs:anyURI, $attrs as attribute()*) as element(link:footnoteArc)
$from |
The value of the xlink:from attribute. |
$to |
The value of the xlink:to attribute. |
$arcrole |
The value of the xlink:arcrole attribute. Usually http://www.xbrl.org/2003/arcrole/fact-footnote |
$attrs |
Additional attributes if required. |
Return a link:footnoteArc element.
xfi:create-footnoteArc(
xs:NCName("loc_note1"),
xs:NCName("res_note1"),
xs:anyURI("http://www.xbrl.org/2003/arcrole/fact-footnote"),
()
)
returns
<link:footnoteArc xlink:type="arc" xlink:to="res_note1" xlink:from="loc_note1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/fact-footnote"/>
Error |
Meaning |
xfie:ItemIsNotNumeric |
Item is not numeric. |
Period must not be forever. |
|
Period is not an instant. |
|
xfie:PeriodIsNotStartEnd |
Period is not a start / end duration. |
Inconsistent entities, segments or scenarios. |
|
Beginning date does not precede end date. |
|
Inconsistent contexts or units with same id. |
|
xfie:QNameIsNotNumericItem |
QName is not a numeric item. |
xfie:QNameIsNotNonNumericItem |
QName is not a non numeric item. |
QName is not an item. |
|
xfie:QNameIsNotTuple |
QName is not a tuple. |
xfie:MismatchingContextApplied |
Context is not valid for an item. |
xfie:MismatchingUnitApplied |
Unit is not valid for an item. |
xfie:InvalidValue |
Value is not valid against the item type. |
xfie:InvalidContentType |
Tuple content is not valid against the tuple content model. |
xfie:ElementIsNotDefinedInDTS |
The element definition cannot be found in the files that are part of the DTS. |
Te node is not derived from xbrli:item |
Date |
Editor |
Remarks |
2005-03-30 |
Simmons |
First draft of an internal working draft for the function specification is created |
2005-04-22 |
Hamscher |
Formatting changes, added examples. |
2005-04-24 |
Hamscher |
Added the requirement of a conformance suite and two interoperable implementations to the approval process. Other typographical corrections. |
2005-06-07 |
Simmons |
Incorporated comments by Walter Hamscher, Harald Schmitt and Atsushi Ohtake. |
2005-08-15 |
Fischer |
Added c-equals and u-equals overloads for item to context/unit. |
2005-08-17 |
Hamscher |
Reformatted document. Rearrangement of document. Gave errors mnemonic names. |
2005-09-23 |
Goto |
Corrections of parameters in example. Sort parameter in several functions. Error code PeriodIsNotDuration is changed to PeriodIsNotStartEnd. Added new error codes for XBRL element creation error. Delete merge-instance method by the F2F result. Predicates functions can take context as parameter. Added new functions cu-equal, pc-equal and pcu-equal. |
2005-11-04 |
Ohtake |
Corrections of some function’s signature in using union as "element(xbrli:period | xbrli:context)" and "element(xbrli:entity | xbrli:context)" etc. |
2005-11-30 |
Simmons |
Added more accessor functions to ease navigation of XBRL instances. This is to remove the need for functions that take more than one parameter type because now anything should be accessible using at most two function calls. |
2005-12-12 |
Simmons |
Added a decimals function. |
2006-01-20 |
IHR |
Added functions to access information in XBRL taxonomies, added functions to deal with footnotes. |
2006-02-20 |
IHR |
All functions are implemented in XQuery language according to the XQuery 1.0 CR-3. A conformance suite with all examples within this document has been created. |
2006-03-15 |
IHR |
Changed function names DTS-taxonomies to DTS-schemas. taxonomy-schema-from-QName to schema-from-QName and taxonomy-element-from-QName to schema-element-from-QName. Editorial changes in the documentation of some functions. Removed the cardinality * in the second parameter of arcs-in-base-set, locators-in-base-set and resources-in-base-set functions. Documented that xfi:period-end function when the period contains an xs:date, returns the dateTime for that date + 1 day. |
2006-05-24 |
IHR |
Overall document review. Added functions to create footnotes The unit function returns the empty sequence if the fact is not numeric rather than raise xfie:ItemIsNotNumeric Removed the error xfie:NonStandardMeasure and the functions that should raise it. |
2006-06-20 |
IHR |
Removed all DTS functions Removed all Taxonomy functions Removed the decimals function Renamed some functions that incorrectly had the word "fact" to use the word "item" Added functions to compare sets of elements as described in table 4 of the XBRL 2.1 Specification. Added x-equal function signature as defined in the XBRL 2.1 specification Added identical nodes and identical-node-sets as defined in Table 4 of the XBRL 2.1 specification Added page numbers and other editorial changes |
2006-10-16 |
IHR |
Changed the returning value of the create-instance function to be a document-node(element(xbrli:xbrl)) document rather than just the xbrli:xbrl element. Without that change the returned instance will never contain a document-uri and the xlink:href attributes cannot be evaluated to their absolute paths. |
2006-11-30 |
HW |
Editorial to prepare for Public Working Draft publication |
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to XBRL International or XBRL organizations, except as required to translate it into languages other than English. Members of XBRL International agree to grant certain licenses under the XBRL International Intellectual Property Policy (www.xbrl.org/legal).
This document and the information contained herein is provided on an "AS IS" basis and XBRL INTERNATIONAL DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
The attention of users of this document is directed to the possibility that compliance with or adoption of XBRL International specifications may require use of an invention covered by patent rights. XBRL International shall not be responsible for identifying patents for which a license may be required by any XBRL International specification, or for conducting legal inquiries into the legal validity or scope of those patents that are brought to its attention. XBRL International specifications are prospective and advisory only. Prospective users are responsible for protecting themselves against liability for infringement of patents. XBRL International takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Members of XBRL International agree to grant certain licenses under the XBRL International Intellectual Property Policy (www.xbrl.org/legal).
|
|
|
Formula Linkbase |
|
|
|
|
Scott Bradner |
|
|
Key words for use in RFCs to Indicate Requirement Levels, March 1997 |
|
|
|
|
Phillip Engel, Walter Hamscher, Geoff Shuetrim, David vun Kannon and Hugh Wallis |
|
|
Extensible Business Reporting Language 2.1 Recommendation with corrected errata to 2004-11-14. |
|
http://www.xbrl.org/Specification/XBRL-RECOMMENDATION-2003-12-31+Corrected-Errata-2005-04-25.rtf |
|
|
Denise Draper. Peter Fankhauser. Mary Fernández. Ashok Malhotra. Kristoffer Rose. Michael Rys. Jérôme Siméon. Philip Wadler. |
|
|
XQuery 1.0 and XPath 2.0 Formal Semantics |
|
|
|
|
Anders Berglund, Scott Boag, Don Chamberlin, Mary Fernández, Michael Kay, Jonathan Robie, and Jérôme Siméon |
|
|
XPath 2.0 |
|
|
|
|
Scott Boag, Don Chamberlin, Mary Fernández, Daniela Florescu, Jonathan Robie, Jérôme Siméon |
|
|
XQuery 1.0: An XML Query Language |
|
|
|
|
[Processes] |
Walter Hamscher |
|
XBRL International Processes 1.0, 4 April 2002 |
|