Presto and XBRL

Posted 11/24/2008 - 11:43 by mcvayw

Since Presto can work with any XML document, it can also work with XBRL, the new standard coming for business reporting.  Working with XBRL is as simple as configuring the namespace properly to parse through the XML nodes.  The simple EMML script below demonstrates the extraction of a value from an XBRL document set up as a Presto REST service.

<mashup xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.jackbe.com/2008-03-01/EMMLSchema ../src/schemas/EMMLSpec.xsd"
        xmlns="http://www.jackbe.com/2008-03-01/EMMLSchema"
        xmlns:macro="http://www.jackbe.com/2008-03-01/EMMLMacro"
        xmlns:xbrl="http://www.xbrl.org/2001/instance"
        xmlns:iascf-pfs="http://www.xbrl.org/taxonomy/int/fr/ias/ci/pfs/2002-11-15"
        xmlns:iso4217="http://www.xbrlSolutions.com/taxonomies/iso4217/2002-06-30"
        name = "xbrlTest">
   
    <operation name="invoke">
        <output name="result" type="document"><xbrlData></xbrlData></output>
        <variable name="tResult" type="document"/>
       
        <invoke service="XBRL1" operation="getData" outputvariable="tResult"/>
       
        <appendresult outputvariable="result">
            <goodwillCurrent>{$tResult/xbrl:group/iascf-pfs:Goodwill[@numericContext="Current_AsOf"]/string()}</goodwillCurrent>
        </appendresult>
    </operation>
   
</mashup>

The key is the xmlns:xbrl="http://www.xbrl.org/2001/instance".  Other namespaces may be used by the XBRL document in question, such as the iascf-pfs namespace.  The XBRL1 sample XBRL document and this simple mashup to extract a value from it can be run from the service explorer on Demos3.

0
Your rating: None