XBRLAPI rendering sample application
Author: Steve Yang (steve2yang at yahoo.com)
Contributor: Geoff Shuetrim (geoff at galexy.net)
What is it?
This is a sample Java application demonstrating the usage of XBRLAPI and its various modules. The Rendering Sample Application loads instance document using XBRLAPI and renders the document according to XBRL Inline Specification 0.64.
The purpose of this module is to give developers step by step instructions to discover a taxonomy set and use the XBRLAPI to store the instance documents and traverse through the various presentation networks to build rendering solutions. This sample application also demonstrates how to build XBRL Inline documents using XBRL API.
The example uses the open source Freemarker template system to simplify the documentation of the desired rendering of the information in the XBRL instance being processed.
The rendered output that can be produced from this Freemarker template defining the report rendering and this target XBRL instance with a presentation linkbase included as an additional URL starting point for DTS discovery. Note that the example rendering only shows the rendered output from a single presentation network. Running the example in full creates a significantly larger report rendering.
Where is it?
The home page for the XBRL API project can be found on the XBRLAPI project web site (http://www.xbrlapi.org/). There you also find information on how to download the latest release as well as all the other information you might need regarding this project.
You can browse the source code in SVN.
- Freemarker 2.3.14 or later version jar file.
Java Virtual Machine (JVM) Arguments:
-Dlog4j.configuration=<location of log4j.properties> -Djava.library.path=<Berkeley DB XML 2.5.16/lib> -classpath=<java class paths>
Program execution involves:
java <JVM ARGUMENTS> org.xbrlapi.data.bdbxml.examples.render.Run <OPTIONS> <URLS>
Where URLS is the space-separated optional URLs of additional starting points for DTS discovery and the mandatory options are:
- -database [the directory that will hold the actual database data (rather than the Oracle Berkeley XML database binaries)]
- -container [the name of the file in the -database directory that will contain the data]
- -cache [the directory containing the document cache]
- -template [the file location of the Freemarker template]*
- -target [the URL of the XBRL instance to be rendered]
- -output [the output file to produce]
* MS Windows issue: Rendering example can have trouble loading Freemarker templates
if they are located in the root directory of a MS Windows drive. Thus, a template location of
will fail while a location
C:\templates\template.ftl will work.
You can view an example Freemarker template in the source repository.
An example follows:
java -Dlog4j.configuration=/home/geoff/log4j.xml -Djava.library.path=/usr/lib/BerkeleyDBXML-2.5.16/lib org.xbrlapi.data.bdbxml.examples.render.Run -database /home/geoff/Data/bdbxml -container renderDatabase -cache /home/geoff/Data/cache -template /home/geoff/template.ftl -target http://www.sec.gov/Archives/edgar/data/1424549/000142454911000031/fvcb-20110930.xml -output /home/geoff/output.html
Licensing and legal issues
XBRLAPI examples are released under the lesser GPL license.