Learn about XULE for XBRL


XBRL (eXtensible Business Reporting Language) is an open, XML-based standard for the electronic submission of business and financial data. Though XBRL specifies what data must be reported and provides a standardized way of doing so, companies and regulatory agencies need a way to ensure the quality of data that is submitted. One approach is by using business rule validation, and XULE is one method that is growing in popularity.

What is XULE?

XULE, from “XBRL rule,” was created by XBRL.US to help filing organizations control the quality of their submitted data. The syntax provides a way to query and check XBRL reports by validating business rules prior to filing.

XBRL.US includes the Center for Data Quality, which is focused improving the usability and effectiveness of submitted XBRL data. The organization notes that inconsistencies and errors in filed XBRL data have prevented the benefits promised by XBRL from being realized fully. The Center formed the Data Quality Committee (DQC) to develop guidance and uniform validation rules to detect and even prevent these errors prior to submission. The resulting DQC Rules are available in various formats and have most recently been introduced in XULE.

XULE is not the only standard created for assessing data quality. XBRL Formula is also a validation rule language for XBRL. However, it is not easy to use and can, in fact, only be utilized if the regulator includes XBRL Formula rules directly in the published taxonomy. The goal behind XULE was to create a modern alternative to XBRL Formula that is more user friendly and independent of any specific taxonomy. Since it’s less complex, XULE is also easier to read by non-technical XBRL stakeholders such as accountants.

XULE syntax provides two ways to check data quality: queries and assertions. Queries can be used to compute data based on numbers provided in an XBRL report and produce output that can be further assessed. Data can also be tested against defined assertions and then actions can be taken based on the results.      

Once they are defined, XULE queries are executed against an XBRL report or taxonomy using a XULE processor. As part of its comprehensive set of XBRL tools, Altova offers both a XULE processor and an interactive XULE editor.

XULE Processor

To assist users working with XBRL data, a complete XULE processor is built into both RaptorXML+XBRL Server and XMLSpy.

For a server-based solution, RaptorXML+XBRL includes a hyper-fast XBRL processor with full support for XULE. Options let you execute XULE documents from the command line, with scripts, and via a number of server and engine APIs, including a powerful Python API. The server can process single XULE documents or rulesets containing multiple XULE documents stored in a ZIP archive.

XMLSpy, Altova’s desktop developer tool for XML, JSON, and XBRL, also includes a built-in XULE processor that powers its XULE editor (described below).

The XULE processor and validator in XMLSpy executes XULE expressions against an XBRL instance document, as well as providing validation of documents for correct syntax according to the XULE specification.

XULE processor in XMLSpy

Developers can also take advantage of a RaptorXML+XBRL Server installed on their network for high performance XULE processing directly inside XMLSpy.

XULE Editor

In addition to its XULE processor and validator, XMLSpy includes the industry’s first XULE editor. Features include syntax coloring, auto-completion of XULE language constructs, integration of XULE documents in XMLSpy projects, and other features to help you understand, write, and test XULE expressions.

While you can access these features to view and edit docs in Text View as shown above, XMLSpy also includes a unique XULE editor window that lets you interactively query the active XBRL report (i.e., XBRL instance document) and immediately view the results of your query.

To make it easy to compose and test queries, the XMLSpy XULE window offers single query mode. Toggling this on enables you to enter an expression without the “output” keyword and as a single query, and to generate the result as a single output. Valid XULE syntax requires the output keyword, but if you want to quickly and interactively query the XBRL document, it is much easier to be able to type a single query without it.

Below you can see the XULE editor window in Single Query mode being used to identify and navigate to facts in an iXBRL report.

XULE editor in XMLSpy

As you type in the XULE window, auto-completion values are offered based on both the XULE language syntax and the structure of the underlying XBRL Taxonomy.

XULE editor with code completion

After composing your query and clicking the Run button on the toolbar, the results of the execution are displayed in the Results pane.

You can click any link in the results to navigate to the respective node in the XBRL instance document, as shown below. Here we have a XULE query that calculates the quick ratio for the periods reported.

Calculate and test XULE rules

For complete details on the various options toolbar buttons available in the XULE window, please refer to the XMLSpy Manual. To help developers, accountants, and other stakeholders learn XULE, the XMLSpy examples project includes several XBRL reports and XULE documents. You’ll even find some simple queries for testing listed directly in the XULE window.

To get started, download a free, 30-day trial of XMLSpy and RaptorXML+XBRL Server.

Tags: , , , ,