dgm9704 / Xoxo

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

Multiple schemaRefElements #87

Closed panterlo closed 2 months ago

panterlo commented 3 months ago

Inline XBRL files containing the following xmlns:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:se-bol-base="http://www.bolagsverket.se/se/fr/comp-base/2020-12-01" xmlns:iso4217="http://www.xbrl.org/2003/iso4217" xmlns:ixt="http://www.xbrl.org/inlineXBRL/transformation/2010-04-20" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:ix="http://www.xbrl.org/2013/inlineXBRL" xmlns:se-gen-base="http://www.taxonomier.se/se/fr/gen-base/2021-10-31" xmlns:se-misc-base="http://www.taxonomier.se/se/fr/misc-base/2017-09-30" xmlns:se-gaap-ext="http://www.taxonomier.se/se/fr/gaap/gaap-ext/2021-10-31" xmlns:se-k2-type="http://www.taxonomier.se/se/fr/k2/datatype" xmlns:se-ar-base="http://www.far.se/se/fr/ar/base/2020-12-01" xmlns:se-mem-base="http://www.taxonomier.se/se/fr/mem-base/2021-10-31" xmlns:se-cd-base="http://www.taxonomier.se/se/fr/cd-base/2021-10-31">

Will render multiple hits in ParseSchemaReference e.g three in this case.

image

It this just a limitation or should I rewrite the class to deal with multiple ns ?

dgm9704 commented 3 months ago

Thank you for informing me! Unfortunately I can't give an answer right away. I have to brush up my memory and go over the code and specifications and get back to you. I won't promise any timeline, but will try to get to this sometime during the coming week. Is this an ESEF report or something else?

panterlo commented 3 months ago

Thanks. All financial reports in Sweden have multiple schemaRefs. Here is an example of iXBRL you can download: https://drive.google.com/drive/folders/1XLLx0GbQjLMBhhNDZBG8-AnZ7xwnZ4Oc?usp=sharing

dgm9704 commented 3 months ago

Ok.

if I understand this correctly, the fix should be pretty simple in theory: fix the logic so that all schemarefs are included from any iXBRL report.

This means the XBRL-XML report also needs to have possibly more than one schemaref. To avoid a breaking change I'm thinking maybe I create a new property that is some collection of schemarefs, make that the target for de/serialization, and change the current Schemaref property to just return the first of that collection. Plus also I need to fix the other conversions to and from XBRL-XML.

When I started this library almost 10 years ago I never believed it would used outside the application and report type it was meant for, so some of the "design decisions" are admitteldy a bit unfortunate. Still, this should be doable in some reasonable amount of time. I'll try to put some beta(s) pretty soon. (again no promises on timeline)

dgm9704 commented 2 months ago

@panterlo

https://drive.google.com/drive/folders/1XLLx0GbQjLMBhhNDZBG8-AnZ7xwnZ4Oc?usp=sharing

Btw If you haven't noticed, there seems to be a typo in that example document, it has the element names as 'schemaref' when they should be 'schemaRef' (Unless I misunderstand something)

dgm9704 commented 2 months ago

There is now code in place that should handle the multiple schemaRefs without breaking changes. I added a test with the report provided. That and all previous tests pass so I don't think I broke anything very badly. I will do some more thinking and checking before I release just to be sure.

dgm9704 commented 2 months ago

Not ready yet, found some problem with handling unit namespace so that needs to be solved.

dgm9704 commented 2 months ago

@panterlo

Version 3.4.0 is now released and should fix this issue regarding mutliple schemaRefs (plus a related bug with unit namespaces)

Source: https://github.com/dgm9704/Xoxo/releases/tag/v3.4.0

Nuget: https://www.nuget.org/packages/Diwen.Xbrl/3.4.0/

Please don't hesitate to make new bug or reopen this one if there are any further problems