Login

Detaching XBRL Formula Rules from their XML roots

Posted on October 20, 2020 by Paul Warren

One of the most powerful features of XBRL is the ability to embed business validation rules into a taxonomy in the form of XBRL Formula Rules. By embedding validation rules, the taxonomy becomes a single, standardised mechanism for defining an XBRL reporting requirement, complete with translatable labels, datatype definitions, links to authoritative reference materials and other metadata.

At a very high level, XBRL Formula rules work by using “filters” to select facts from an XBRL Report, and then evaluating an expression that performs some check on the selected facts — for example, checking that fact A is the sum of facts B and C. The expressions may make use of XBRL Formula functions to obtain other information about the fact, such as whether the fact relates to an instant or a duration.

XBRL Formula uses the W3C’s XPath 2 expression language for defining these checks. XPath was built as an expression language for working with XML documents, and as well as being able to perform this type of check, it can also be used to navigate and select elements and attributes directly from an XML document. As XBRL data has traditionally been represented in XML, this means that XBRL Formula Rules can make use of these “node navigation” features to select information directly from an XBRL document, rather than using filters and XBRL functions.

XML node navigation: a barrier to XBRL evolution

Although the XBRL Formula specification permits it, use of XML node navigation has never been the preferred way of writing Formula rules because working with XBRL data as XML in this way is typically very cumbersome and error prone. With the introduction of the Open Information Model, and the accompanying xBRL-JSON and xBRL-CSV formats, this XML node navigation becomes a real problem because with a JSON or CSV-based report, there is no underlying XML document. XBRL Formula rules that rely on XPath’s XML node navigation features can’t be executed directly on xBRL-JSON or xBRL-CSV reports.

Even when working with an xBRL-XML report, using XML node navigation means that processors need to retain an XML document model in memory, as well as an XBRL model, which can be a significant overhead.

Whilst most XBRL Formula rules can be written entirely using filters and XBRL functions, there are some cases where this is not possible, and XML node navigation is the only way to get the data necessary to evaluate the rule. The XBRL Formula Working Group is working to identify such cases so that new XBRL functions can be introduced that remove the need for using XML node navigation.

XBRL members have recently completed a review of the XBRL Formula Rules in use in the European Banking Authority’s (EBA) and European Insurance and Occupational Pensions Authority’s (EIOPA) taxonomies in order to identify such cases, and as a result, a number of new functions are being added to the Functions Registry so that rules can be made independent of the report syntax.

How you can help

If you’re involved in developing XBRL Formula Rules there are two things you can do to help:

  1. Avoid using XML node navigation in your formula expressions wherever possible, rewriting them to use functions or filters. Node navigation generally involves / or //.
  2. Where node navigation is unavoidable, please get in touch with the Formula Working Group with details of the rule so that additional functions can be developed to avoid this in the future.
Other Posts


Newsletter
Newsletter

Would you like
to learn more?

Join our Newsletter mailing list to
stay plugged in to the latest
information about XBRL around the world.

By clicking submit you agree to the XBRL International privacy policy which can be found at xbrl.org/privacy