XhBtRmL Configuration file and Excel data source driver: Difference between pages

From XBRLWiki
(Difference between pages)
Jump to navigationJump to search
 
 
Line 1: Line 1:
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.
==Description==


The configuration file must be a valid instance of an XML document according to the schema documented in this section.
The Excel Data Source Driver is a configurable generic driver to obtain data from excel files and create XBRL reports inside the automatization framework provided by the XBRL Mapper engine designed by Reporting Standard.


==Namespace==
==Editors==


The namespace for the configuration file is '''<nowiki>http://www.reportingstandard.com/transform/0</nowiki>'''
The installation of Reporting Standard Mapper already installs an Excel plug-in that is able to edit the configuration file described in the next section. Advanced users can take advantage of editing the XML configuration files manually or creating their own editing applications.


==Schema location==
==Configuration file==


The schema location for the configuration file is http://www.reportingstandard.com/taxonomies/versioning/transformer.xsd
The configuration file is provided during the driver declaration inside the instance document template file. See [[XBRL Template File#Definition_of_data_sources]] for more information. The driver class is '''com.ihr.xbrl.mapper.source.ExcelDataSource'''


==Sample file==
Sample Excel driver data source declaration:
<syntaxhighlight lang="xml">
  <datasources>
    <source
      id="source0"
      class="com.ihr.xbrl.mapper.source.ExcelDataSource"
      config="Excel-driver-config.xml"/>
  </datasources>
</syntaxhighlight>
 
The configuration file must be valid according to a very simple XML Schema that has no namespace and that is published in the following official location <nowiki>http://www.reportingstandard.com/schemas/mapper/XBRLDataSourceExcelMapSchema.xsd</nowiki>


This is the content of a sample configuration file:
Sample configuration file:
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<!-- Sample configuration file for ExcelDataSource content -->
<!-- This is a configration file to transform XBRL into another format or databases etc -->
<XBRLDataSourceExcelMap
<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"
   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">
   xsi:noNamespaceSchemaLocation
     <dts>
    ="http://www.reportingstandard.com/schemas/mapper/XBRLDataSourceExcelMapSchema.xsd">
        <dimensional/>
  <map>
        <file>samples/taxonomies/sample/sampleTaxonomy.xsd</file>
     <mapId>ifrs-gp_CostOfSales</mapId>
        <transformer class="com.ihr.xbrl.transform.target.HTMLFactHandler" configFile="samples/htmlFactConfigFile.xml"/>
    <cell>CostsSheet!costofsales</cell>
        <resultInstances>1</resultInstances>
  </map>
        <result class="com.ihr.xbrl.transform.target.HTMLReportHandler" configFile="samples/htmlReportConfigFileSample.xml"/>
  <map>
    </dts>
    <mapId>ifrs-gp_Revenues</mapId>
</xbrlTransformation>
    <cell>RevenuesSheet!D1</cell>
  </map>
</XBRLDataSourceExcelMap>
</syntaxhighlight>
</syntaxhighlight>


==Configuration file content==
The example above shows the content of the mapping configuration file. The root element is the '''XBRLDataSourceExcelMap''' element whose content is a set of '''map''' elements. In turn, a '''map''' element is a sequence of two other elements called '''mapId''' and '''cell'''.
 
===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===
The '''mapId''' element content is a string that corresponds to the mapIdentifier string of existing events [[XBRL Template File#Events]] in the instance document template.


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.
The '''cell''' element content is a cell reference inside the Excel book. It may have two different formats:
* explicit address to a specific cell using ''sheetname''!''Reference'' where ''Reference'' takes the form for a colum letter followed by the row number, or
* relative address to a specific cell using ''sheetname''!''cellname'' where ''cellname'' is an existing named range in the excel file.


==Navigation==
==Navigation==
[[Main Page]] | [[XBRL API related discussions]]
[[Main Page]] | [[XBRLmapper]]

Revision as of 22:10, 6 September 2009

Description

The Excel Data Source Driver is a configurable generic driver to obtain data from excel files and create XBRL reports inside the automatization framework provided by the XBRL Mapper engine designed by Reporting Standard.

Editors

The installation of Reporting Standard Mapper already installs an Excel plug-in that is able to edit the configuration file described in the next section. Advanced users can take advantage of editing the XML configuration files manually or creating their own editing applications.

Configuration file

The configuration file is provided during the driver declaration inside the instance document template file. See XBRL Template File#Definition_of_data_sources for more information. The driver class is com.ihr.xbrl.mapper.source.ExcelDataSource

Sample Excel driver data source declaration: <syntaxhighlight lang="xml">

 <datasources>
   <source 
     id="source0" 
     class="com.ihr.xbrl.mapper.source.ExcelDataSource" 
     config="Excel-driver-config.xml"/>
 </datasources>

</syntaxhighlight>

The configuration file must be valid according to a very simple XML Schema that has no namespace and that is published in the following official location http://www.reportingstandard.com/schemas/mapper/XBRLDataSourceExcelMapSchema.xsd

Sample configuration file: <syntaxhighlight lang="xml"> <XBRLDataSourceExcelMap

 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:noNamespaceSchemaLocation
   ="http://www.reportingstandard.com/schemas/mapper/XBRLDataSourceExcelMapSchema.xsd">
 <map>
   <mapId>ifrs-gp_CostOfSales</mapId>
   <cell>CostsSheet!costofsales</cell>
 </map>
 <map>
   <mapId>ifrs-gp_Revenues</mapId>
   <cell>RevenuesSheet!D1</cell>
 </map>

</XBRLDataSourceExcelMap> </syntaxhighlight>

The example above shows the content of the mapping configuration file. The root element is the XBRLDataSourceExcelMap element whose content is a set of map elements. In turn, a map element is a sequence of two other elements called mapId and cell.

The mapId element content is a string that corresponds to the mapIdentifier string of existing events XBRL Template File#Events in the instance document template.

The cell element content is a cell reference inside the Excel book. It may have two different formats:

  • explicit address to a specific cell using sheetname!Reference where Reference takes the form for a colum letter followed by the row number, or
  • relative address to a specific cell using sheetname!cellname where cellname is an existing named range in the excel file.

Navigation

Main Page | XBRLmapper