Creating an XBRL-Instance

Help
Nnang
2012-11-29
2013-05-02
  • Nnang

    Nnang - 2012-11-29

    Hi,

    how can I use the API to generate an XBRL-Instance? I couldn´t find it anywhere.

    Thank you.
    Virgo

     
  • Geoffrey Shuetrim

    Hi,

    The API is readonly as the website emphasises.  That said, you can use a templating system like Freemarker to give you an XBRL instance structure and then build a data model based on analysis of XBRL taxonomies and other data sources to merge into the Freemarker template to produce an XBRL instance.  That is my usual strategy.  There is an example of using freemarker to build an HTMlL report rather than an instance.  It is on the XBRLAPI.ORG website.

    Regards

    Geoff Shuetrim

     
  • Nnang

    Nnang - 2012-12-04

    Hi,

    Thanks for the tip. I have never used a templating system, specially Freemarker. But as I saw in the Run-example, it seems quite convenient to use it.
    Can you please lead me, I mean, give me more tips, how I can use freemarker to give me an XBRL Instance structure? In the freemarker-manuel, the directive to build a template are only for html and simple xml, so that it is difficult for me to do it for the XBRL-Instance.

    Regards

    Virgo

     
  • Geoffrey Shuetrim

    I am afraid I do not have the time or resources to set out all the details.  However, an XBRL instance is just XML and pretty simple XML at that.  Create a freemarker template that has the boilerplate XBRL structure (the root element and namespaces etc.).  Have a data model containing the facts to be inserted into the instance.  Collect them within an Aspect model as defined in the XBRLAPI.  Process the aspect model to build contexts to insert into the instance boilerplate, getting the markup for periods and entities etc from the template itself.  Also process the aspect model to insert fact values into element structures.

    Then you are more or less done (aside from units etc).

    Regards

    Geoff S

     
  • Nnang

    Nnang - 2013-04-04

    Hi,
    Can someone tell what is wrong  in the next lines. It ist an extraction of my freemarker-template. 
    The line 4 ist suppose to test a condition. But the line ist just printed as writing.

    1. <#list contexts as context>
    2. 
    3. <xbrli:context id="${context.getId()}">
    4. 
    5. <xbrli:period>
    6. <xbrli:instant>
    7. ${context.getBisPeriode().getBisDatum()}
    8. </xbrli:instant>
    9. </xbrli:period>
    10.
    11. <xbrli:period>
    12. <xbrli:startDate>
    13. ${context.getVonPeriode().getVonDatum()}
    … </xbrli:startDate>
    <xbrli:endDate>
    ${context.getBisPeriode().getBisDatum()}
    </xbrli:endDate>
    </xbrli:period>

    </xbrli:context> 
    </#list>

    Here is the result:

      <xbrli:context id="Zeitpunkt2006">
     
     
    <xbrli:period>
    <xbrli:instant>
    31.12.2006
    </xbrli:instant>
    </xbrli:period>

    <xbrli:period>
    <xbrli:startDate>
    01.01.2006
    </xbrli:startDate>
    <xbrli:endDate>
    31.12.2006
    </xbrli:endDate>
    </xbrli:period>

    </xbrli:context> 

      <xbrli:context id="Zeitraum2006">
     
     
    <xbrli:period>
    <xbrli:instant>
    31.12.2006
    </xbrli:instant>
    </xbrli:period>

    <xbrli:period>
    <xbrli:startDate>
    01.01.2006
    </xbrli:startDate>
    <xbrli:endDate>
    31.12.2006
    </xbrli:endDate>
    </xbrli:period>

    </xbrli:context> 

    Best regards!
    Virgo

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks