Coder Social home page Coder Social logo

Comments (3)

easyjoh avatar easyjoh commented on July 17, 2024

Also for this one, Annual report 2018.

http://regnskaber.virk.dk/11049896/ZG9rdW1lbnRsYWdlcjovLzAzL2E1L2UyLzBjLzM0LzVmNzMtNDlmMS05Yzc0LWEzMmQwZDQ2NTNkZg.xml

from xbrl.

bseddon avatar bseddon commented on July 17, 2024

Test2.xml is a binary not an Xml file so of course code expecting to find an Xml file will complain if the first character of the file is not an opening angle bracket. Although this file is named as an Xml file it is really a tape archive (TAR) file. If you ignore the extension and expand it with a an archiving tool you will see the instance document Xml.

ZG9rdW1lbnRsYWdlcjovLzAzL2E1L2UyLzBjLzM0LzVmNzMtNDlmMS05Yzc0LWEzMmQwZDQ2NTNkZg.xml is not a valid Xml file because it begins with a blank line. Removing the blank line solves the problem. You could solve this issue by adding a line of code around line 241 of report.php to open the file, remove the line and save it. The processor will not adjust the instance document change the instance document because it has to work with what its given not make assumptions about what a user intended.

I have been able to process both instance document test2.xml (after extracting from the archive) and the annual report 2018 (after removing the blank line) using report.php from the case study example. The two blocks below are the results I see when processing these files starting with test2.xml.

You have not mentioned what step you have taken. A possible explanation for your issue with the annual report is that you have not compiled the 2017-10-01 taxonomy on which it depends. This step is necessary when using instance documents based on the DK taxonomies because the instance documents refer to virtual locations inside the taxonomy packages produced by the DCCA. Compiling isalso suitable for this application because it improves performance massively (100 times or more).

test2.xml

Array
(
    [Omsaetning] => Array
        (
            [name] => Revenue
            [namespace] => http://xbrl.dcca.dk/fsa
            [qname] => fsa:Revenue
            [values] => Array
                (
                    [2018] => Array
                        (
                            [value] => 41700000
                            [unit] => DKK
                            [en] => Revenue
                            [da] => Nettoomsætning
                        )
                )
        )

    [Bruttofortjeneste] => Array
        (
            [name] => GrossProfitLoss
            [namespace] => http://xbrl.dcca.dk/fsa
            [qname] => fsa:GrossProfitLoss
            [values] => Array
                (
                    [2018] => Array
                        (
                            [value] => 
                            [unit] => 
                        )
                )
        )

    [Resultat før skat] => Array
        (
            [name] => ProfitLossFromOrdinaryActivitiesBeforeTax
            [namespace] => http://xbrl.dcca.dk/fsa
            [qname] => fsa:ProfitLossFromOrdinaryActivitiesBeforeTax
            [values] => Array
                (
                    [2018] => Array
                        (
                            [value] => 430100000
                            [unit] => DKK
                            [en] => Profit (loss) from ordinary activities before tax
                            [da] => Ordinært resultat før skat
                        )
                )
        )

    [Årets resultat] => Array
        (
            [name] => ProfitLoss
            [namespace] => http://xbrl.dcca.dk/fsa
            [qname] => fsa:ProfitLoss
            [values] => Array
                (
                    [2018] => Array
                        (
                            [value] => 457800000
                            [unit] => DKK
                            [en] => Profit (loss)
                            [da] => Ã…rets resultat
                        )
                )
        )

    [Egenkapital] => Array
        (
            [name] => Equity
            [namespace] => http://xbrl.dcca.dk/fsa
            [qname] => fsa:Equity
            [values] => Array
                (
                    [2018] => Array
                        (
                            [value] => 3380400000
                            [unit] => DKK
                            [en] => Equity
                            [da] => Egenkapital
                        )
                )
        )

    [Balance] => Array
        (
            [name] => Assets
            [namespace] => http://xbrl.dcca.dk/fsa
            [qname] => fsa:Assets
            [values] => Array
                (
                    [2018] => Array
                        (
                            [value] => 3442500000
                            [unit] => DKK
                            [en] => Assets
                            [da] => Aktiver
                        )
                )
        )
)

ZG9rdW1lbnRsYWdlcjovLzAzL2E1L2UyLzBjLzM0LzVmNzMtNDlmMS05Yzc0LWEzMmQwZDQ2NTNkZg.xml

Array
(
    [Omsaetning] => Array
        (
            [name] => Revenue
            [namespace] => http://xbrl.dcca.dk/fsa
            [qname] => fsa:Revenue
            [values] => Array
                (
                    [2018] => Array
                        (
                            [value] => 3860440000
                            [unit] => DKK
                            [en] => Revenue
                            [da] => Nettoomsætning
                        )
                )
        )

    [Bruttofortjeneste] => Array
        (
            [name] => GrossProfitLoss
            [namespace] => http://xbrl.dcca.dk/fsa
            [qname] => fsa:GrossProfitLoss
            [values] => Array
                (
                    [2018] => Array
                        (
                            [value] => 
                            [unit] => 
                        )
                )
        )

    [Resultat før skat] => Array
        (
            [name] => ProfitLossFromOrdinaryActivitiesBeforeTax
            [namespace] => http://xbrl.dcca.dk/fsa
            [qname] => fsa:ProfitLossFromOrdinaryActivitiesBeforeTax
            [values] => Array
                (
                    [2018] => Array
                        (
                            [value] => -6953000
                            [unit] => DKK
                            [en] => Profit (loss) from ordinary activities before tax
                            [da] => Ordinært resultat før skat
                        )
                )
        )

    [Årets resultat] => Array
        (
            [name] => ProfitLoss
            [namespace] => http://xbrl.dcca.dk/fsa
            [qname] => fsa:ProfitLoss
            [values] => Array
                (
                    [2018] => Array
                        (
                            [value] => -6292000
                            [unit] => DKK
                            [en] => Profit (loss)
                            [da] => Ã…rets resultat
                        )
                )
        )

    [Egenkapital] => Array
        (
            [name] => Equity
            [namespace] => http://xbrl.dcca.dk/fsa
            [qname] => fsa:Equity
            [values] => Array
                (
                    [2018] => Array
                        (
                            [value] => 162962000
                            [unit] => DKK
                            [en] => Equity
                            [da] => Egenkapital
                        )
                )
        )
    [Balance] => Array
        (
            [name] => Assets
            [namespace] => http://xbrl.dcca.dk/fsa
            [qname] => fsa:Assets
            [values] => Array
                (
                    [2018] => Array
                        (
                            [value] => 1908813000
                            [unit] => DKK
                            [en] => Assets
                            [da] => Aktiver
                        )
                )
        )
)

from xbrl.

easyjoh avatar easyjoh commented on July 17, 2024

Thank you very much. I didn't realize the downloaded files were gzip archives.

As for the blank line, I would expect the DOM parser to ignore initial whitespace, but will work around this.

Thank you for a great library.

from xbrl.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.