dgm9704 / Xoxo

read, write, compare, convert XBRL reports
GNU Lesser General Public License v3.0
27 stars 9 forks source link

Fails to parse ExplicitMember with whitespace in value #65

Closed initram closed 4 years ago

initram commented 4 years ago

I cannot parse files where there is an explicitMember-tag with whitespace before the actual value. I don't know if this is allowed by the spec, but I see it in some of the official XBRL documents from danish company registry.

An example is this document: http://regnskaber.virk.dk/99627653/ZG9rdW1lbnRsYWdlcjovLzAzLzBiLzY3L2FlL2EyLzlkMDEtNGEwOS1hMWU2LTgwNjI5ZjdmYjMyYg.xml

I was able to get it to parse the file by modifying the ExplicitMember class to serialize the Value member as a string and then trimming it before passing it to XmlQualifiedName. Not sure if you like that way of doing it, but I can create a pull request if you like.

dgm9704 commented 4 years ago

Thank you for reporting this!

My main focus with this so far has been on EBA and EIOPA reporting, but of course I want to support others also. So I will go over the EBA/EIOPA specs and documentation (I do remember there was some "silliness" somewhere with handling of whitespace). I will also try to take a look at the Danish company registry specs. I can't make any promises but I will try to get back to you by the end of the week.

dgm9704 commented 4 years ago

I'm just quickly going over the code to refresh my memory... It might be that if instance reading was done via eg. XmlReader or something else instead of a Stream, the whitespace could be automatically stripped and problem would go away.

dgm9704 commented 4 years ago

Hello. Sorry for the long wait, but there’s been distracting ”stuff” happening lately. The more I look at this, the more I feel that there shouldn’t be whitespace around the value. Could you perhaps give a link where I could find some specs the document as i couldn’t find any? eg. EBA and EIOPA have something called ”XBRL Filing Rules” and most likely Danish company registry has something similar? (It would help if it was in English)

initram commented 4 years ago

Hey,

The only page with some documentation that I have been able to find is this page in Danish (maybe google translate can help): https://erhvervsstyrelsen.dk/vejledning-teknisk-vejledning-og-dokumentation-regnskab-20-taksonomier-aktuelle

This mentions two taxonomies that can be used in Denmark. The one I linked should be the ÅRL-taxonomy. It has some English documentation linked from that page, though I am not sure if it is specific enough to cover something like this. The English pdf link is this https://erhvervsstyrelsen.dk/sites/default/files/2019-03/documentation_dcca_xbrltaxonomyframeworkarchitecture20151001v10_3_0.pdf

Let me know if I can be of any more help to you. For now I have the issue fixed in a locally build, so I am not in any rush to have this fixed. (Though I would prefer to use an official release)

dgm9704 commented 4 years ago

Thank you. I think we need to allow the whitespace. There is already custom (de)serialiazation in place for TypedMember so I did the same for ExplicitMember. Your example file doesn’t cause errors after that, but a couple of other tests went red. So after some (hopefully minor) adjustments I will make a beta release.

dgm9704 commented 4 years ago

Ok finally now I got the fix pushed, and there is a new nuget version also for testing. (1.0.4-beta)

initram commented 4 years ago

Okay, I will have a look at it in a few days. Thanks for looking into it.

dgm9704 commented 4 years ago

Looks like this was fixed so I'm closing it. Please reopen if there the problem still exists.