XhBtRmL and XhBtRmL Configuration file: Difference between pages

From XBRLWiki
(Difference between pages)
Jump to navigationJump to search
 
 
Line 1: Line 1:
==Product page==
During the creation of an [[http://www.reportingstandard.com/apidoc/com/ihr/xbrl/transform/TransformProcessor.html TransformProcessor]] instance, the URI of a configuration file is required. The configuration file contains information required by the TransformProcessor in order to get all required information.


[[http://www.reportingstandard.com/XBRLtoHTML.xhtml XhBtRmL XBRL to HTML Template language]]
The configuration file must be a valid instance of an XML document according to the schema documented in this section.


[[File:XBRLMapperIcon.png|none|left|XhBtRmL template language to produce HTML representation of XBRL reports]]
==Namespace==


==Description==
The namespace for the configuration file is '''<nowiki>http://www.reportingstandard.com/transform/0</nowiki>'''


XhBtRmL is a simple language designed to create templates that produce HTML representation of the content of XBRL reports. It can be used for multiple purposes as, for example, to produce a nice web page directly from the content of an XBRL report or for transforming the XBRL report into another XML document, for example; an iXBRL report or an XML-FO (for the production of PDF) etc.
==Schema location==


The idea regarding the architecture behind XhBtRmL is the same as in XSLT. There is an Infoset (Information and structure of information) and a transformation language that is able to provide access to the information that exist on the Infoset and produce an output document. The reason why XSLT is not the right solution for working with XBRL is because XSLT was designed to work with the limited infoset of XML nodes (elements, attributes, namespaces, values, ...) while the XBRL Infoset is much richer that just elements and attributes. It contains concept definitions with specific XBRL properties, labels in multiple languages, presentation, calculation and reference relationships, definition relationships with other concept definitions etc. All this information may be diseminated in multiple files composing a complex DTS. This is certainly not an efficient scenario for XSLT or the production of XSLT pages.
The schema location for the configuration file is http://www.reportingstandard.com/taxonomies/versioning/transformer.xsd


==Testing XhBtRmL==
==Sample file==


The best way to test XhBtRmL is creating your own templates or modifying the content of existing templates. The first thing the user needs is a testing environment in which the user can start submit a web page and see the result. This walkthrough will guide the user step by step about the following topics:
This is the content of a sample configuration file:
# Installation instructions of the testing environment
<syntaxhighlight lang="xml">
# Understanding the testing environment
<?xml version="1.0" encoding="UTF-8"?>
# Reference documentation
<!-- This is a configration file to transform XBRL into another format or databases etc -->
<xbrlTransformation
  xmlns="http://www.reportingstandard.com/transform/0"
  xmlns:xbrli="http://www.xbrl.org/2003/instance"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.reportingstandard.com/transform/0 http://www.reportingstandard.com/taxonomies/versioning/transformer.xsd">
    <dts>
        <dimensional/>
        <file>samples/taxonomies/sample/sampleTaxonomy.xsd</file>
        <transformer class="com.ihr.xbrl.transform.target.HTMLFactHandler" configFile="samples/htmlFactConfigFile.xml"/>
        <resultInstances>1</resultInstances>
        <result class="com.ihr.xbrl.transform.target.HTMLReportHandler" configFile="samples/htmlReportConfigFileSample.xml"/>
    </dts>
</xbrlTransformation>
</syntaxhighlight>


===Installation instructions of the testing environment===
==Configuration file content==


The testing environment can be installed under the Java platform using the Tomcat Application Server or it can be installed using the .NET platform on windows.
===Root element===


====Installation under Windows .NET====
The root element is '''<xbrlTransformation ...>'''. The content of the '''<xbrlTransformation ...>''' is a sequence of one or more '''dts''' elements. This means, the same TransformProcessor instance can be used for multiple DTSs simultaneously.


# Download and install the latest version of Reporting Standard tools [[http://www.reportingstandard.com/downloads.xhtml Direct access to the downloads Page]].
===The '''dts''' element===
# Install the required licenses in order to be able to run Reporting Standard code in your computer. [[http://www.reportingstandard.com/license-req-auto.xhtml Direct link to request evaluation licenses form]].
# Download the .NET version of the XBRL Libraries from this link: [[http://www.reportingstandard.net/RS_XBRL_API_in_DotNET.zip RS_XBRL_API_in_DotNET.zip]]. The zip file contains a directory with 7 DLLs. The DLLs will be used later as references from .NET code. The user can install the DLLs in the GAC or in a folder. During this walkthrough we will assume the user has extracted the DLLs into a directory called '''RS_XBRL_API_in_DotNET'''.
# Download the sample project from this link: [[http://www.reportingstandard.net/XhBtRmL_DotNET.zip XhBtRmL_DotNET.zip]]. Now uncompress the content somewhere in your hard drive.
# The XhBtRmL solution contains a web project also called XhBtRmL. Depending on the user's operating system version he'll have to configure different things in the IIS web server in order to start serving .aspx pages. Under Windows XP Proffessional edition this requires installing IIS 5.1 and Windows .NET framework 2.0 (3.5 is recommended for working with the XBRL API). After that, it is necessary giving read permissions to the ASPNET user to the following directories:
## The '''lib''' directory where Reporting Standard License files and library files are installed.
## The '''XhBtRmL''' directory where the project source code is located (this is, for example, the directory where the file AssemblyInfo.cs is located).
## and write permissions to the '''temp''' directory under the '''XhBtRmL''' directory. This is because the web server will write downloaded files here.
# Under Windows Vista, similar work will be necessary regarding the permissions of the users running the web server process.
# Open the project with you C# IDE (Visual Studio or Sharp Develop)
# Now resolve the unresolved references. There may be unresolved references to the following files: IKVM.AWT.WinForms, IKVM.OpenJDK.ClassLibrary, IKVM.Runtime, IKVM.Runtime.JNI, xbrljlib-2.0, xbrlmap and xbrlpojolib. The user will find that all required DLLs in order to resolve the references are located in the '''RS_XBRL_API_in_DotNET''' directory.
# Compile the project
# If you have not already do so, configure your web server to serve web pages under the directory where the Default.aspx file exist use the directory name '''XhBtRmL''' as the name of the virtual directory.
# Start the web server and point your browser to the root page <nowiki>http://localhost/XhBtRmL/Default.aspx</nowiki>
# After some seconds (the application takes some time to start) the user would see a simple web form to submit a sample XBRL report followed by an OK button on the next row
# Press the '''Browse''' button and search for the sampleInstance.xbrl document that is located in the project directory '''XhBtRmL'''
# Press the '''OK''' button and submit that file for processing. The process will take more time the first time it is executed because the templates are not compiled. The compiled templates are stored in memory in order to accelerate further executions.
# Read the Reference Documentation section in order to know how the process works and how to create new templates adapted for other taxonomies.


====Installation under Java platform====
This element defines how a DTS is defined and what the TransformProcessor will do with it. The first child of the '''dts''' element is optional and is an indication to let the processor knows if the DTS will contain or not dimensions. This is indicated by the optional empty '''dimensional''' element.


# Download the Java sample project from this link: [[http://www.reportingstandard.net/XhBtRmL_Java.zip XhBtRmL_Java.zip]]
===The '''file''' element===
# Use Eclipse or your favorite IDE in order to set-up the project. The project contains a simple form in a web page called default.html and JSP page called process.jsp that contains all required code in order to produce an HTML representation of the sample XBRL report. There is also a static class called Config that is used from the JSP page and from a Servlet called InicializationServlet. The only purpose of the Initialization Servlet is to create an instance of the transformer object using the configuration file. The Transformer will be reused between  calls and it is thread safe so the reated instance will be stored in the Config object for later use.
# Review the content of the web.xml file and deploy the application according to your application server settings.
# Start the web server and point your browser to the root page <nowiki>http://localhost/XhBtRmL/Default.html</nowiki>
# After some seconds (the application takes some time to start) the user would see a simple web form to submit a sample XBRL report followed by an OK button on the next row
# Press the '''Browse''' button and search for the sampleInstance.xbrl document that is located in the project directory '''XhBtRmL'''
# Press the '''OK''' button and submit that file for processing. The process will take more time the first time it is executed because the templates are not compiled. The compiled templates are stored in memory in order to accelerate further executions.
# Read the Reference Documentation section in order to know how the process works and how to create new templates adapted for other taxonomies.


===Understanding the testing environment===
The next element is '''file'''. The content of the '''file''' element is a relative or absolute URL pointing to a file. There may be one or many '''file''' elements. '''file''' elements will be used in order to define the DTS that should match the DTS of instance document submitted to the transformer for processing.


The testing environment consist of the following components:
A DTS will be defined inside the transformation processor using the URLs indicated in '''file''' elements and the DTS discovery rules in section 3.2 of the XBRL 2.1 specification. If the user points to a schema that contains linkbases, the DTS will contain the schema and the discovered linkbases. A matching instance document accepted for processing must contain the same documents set in the DTS.


# A sample ''XBRL Taxonomy''. This taxonomy is local (not officially published, used only for this prototype and is not stored in Reporting Standard Taxonomy Catalog). The taxonomy schema can be located in the project directory '''config/samples/taxonomies/sample/sampleTaxonomy.xsd'''.
===The '''transformer''' element===
# A sample ''XBRL Report''. The report is in a file called '''sampleInstance.xbrl''' that is valid according to the sampleTaxonomy.xsd. In order to validate the instance document the user may need to store the instance document in the '''temp''' directory.
# A ''Web form'' called '''Default.aspx''' in the .NET windows platform or '''process.jsp''' in the Java platform that receives the xbrl file and send it to the [[http://www.reportingstandard.com/apidoc/com/ihr/xbrl/transform/TransformProcessor.html TransformProcessor]] instance for transformation from XBRL format to HTML format. The [[http://www.reportingstandard.com/apidoc/com/ihr/xbrl/transform/TransformProcessor.html TransformProcessor]] is initialized with a configuration file when the application is started.
# A ''Configuration file'' for the [[http://www.reportingstandard.com/apidoc/com/ihr/xbrl/transform/TransformProcessor.html TransformProcessor]]. With information about the DTS, the templates etc.
# A set of ''Templates'' that defines the final user interface


==Reference documentation==
Transformation requires an object responsible of attending transformation events. This is done by classes implementing interfaces, in this case the transformer is implemented by the ''com.ihr.xbrl.transform.target.HTMLFactHandler'' class. The interface of that class accepts a configuration file but the implementation class actually does not require a configuration file so the parameter is not used.
 
===The '''resultInstances''' element===
 
The TransformProcessor instance keeps an internal pool of created ReportHandlers. ReportHandlers are used in order to allow multiple threads to run concurrently on the transformation from XBRL to HTML without interfering one in the memory space of the other. The parameter indicated here is the initial pool size. The pool grows up automatically.
 
===The '''result''' element===
 
This is the class and configuration file for the ReportHandler. In this example the class in use is the ''com.ihr.xbrl.transform.target.HTMLReportHandler'' and this class requires a configuration file in order to indicate special number formatting options, default number formatting options and the initial template to be used. Refer to the section [[XhBtRmL HTMLReportHandler Configuration file]] for more information.
 
==Navigation==
[[Main Page]] | [[XhBtRmL]]

Latest revision as of 19:05, 23 August 2009

During the creation of an [TransformProcessor] instance, the URI of a configuration file is required. The configuration file contains information required by the TransformProcessor in order to get all required information.

The configuration file must be a valid instance of an XML document according to the schema documented in this section.

Namespace

The namespace for the configuration file is http://www.reportingstandard.com/transform/0

Schema location

The schema location for the configuration file is http://www.reportingstandard.com/taxonomies/versioning/transformer.xsd

Sample file

This is the content of a sample configuration file: <syntaxhighlight lang="xml"> <?xml version="1.0" encoding="UTF-8"?> <xbrlTransformation

 xmlns="http://www.reportingstandard.com/transform/0" 
 xmlns:xbrli="http://www.xbrl.org/2003/instance"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.reportingstandard.com/transform/0 http://www.reportingstandard.com/taxonomies/versioning/transformer.xsd">
   <dts>
       <dimensional/>
       <file>samples/taxonomies/sample/sampleTaxonomy.xsd</file>
       <transformer class="com.ihr.xbrl.transform.target.HTMLFactHandler" configFile="samples/htmlFactConfigFile.xml"/>
       <resultInstances>1</resultInstances>
       <result class="com.ihr.xbrl.transform.target.HTMLReportHandler" configFile="samples/htmlReportConfigFileSample.xml"/>
   </dts>

</xbrlTransformation> </syntaxhighlight>

Configuration file content

Root element

The root element is <xbrlTransformation ...>. The content of the <xbrlTransformation ...> is a sequence of one or more dts elements. This means, the same TransformProcessor instance can be used for multiple DTSs simultaneously.

The dts element

This element defines how a DTS is defined and what the TransformProcessor will do with it. The first child of the dts element is optional and is an indication to let the processor knows if the DTS will contain or not dimensions. This is indicated by the optional empty dimensional element.

The file element

The next element is file. The content of the file element is a relative or absolute URL pointing to a file. There may be one or many file elements. file elements will be used in order to define the DTS that should match the DTS of instance document submitted to the transformer for processing.

A DTS will be defined inside the transformation processor using the URLs indicated in file elements and the DTS discovery rules in section 3.2 of the XBRL 2.1 specification. If the user points to a schema that contains linkbases, the DTS will contain the schema and the discovered linkbases. A matching instance document accepted for processing must contain the same documents set in the DTS.

The transformer element

Transformation requires an object responsible of attending transformation events. This is done by classes implementing interfaces, in this case the transformer is implemented by the com.ihr.xbrl.transform.target.HTMLFactHandler class. The interface of that class accepts a configuration file but the implementation class actually does not require a configuration file so the parameter is not used.

The resultInstances element

The TransformProcessor instance keeps an internal pool of created ReportHandlers. ReportHandlers are used in order to allow multiple threads to run concurrently on the transformation from XBRL to HTML without interfering one in the memory space of the other. The parameter indicated here is the initial pool size. The pool grows up automatically.

The result element

This is the class and configuration file for the ReportHandler. In this example the class in use is the com.ihr.xbrl.transform.target.HTMLReportHandler and this class requires a configuration file in order to indicate special number formatting options, default number formatting options and the initial template to be used. Refer to the section XhBtRmL HTMLReportHandler Configuration file for more information.

Navigation

Main Page | XhBtRmL