Comments (8)
Seems like the instance document you are trying to parse is using the ix
prefix without defining the namespace.
Normally the submission should declare all prefixes it is using with xmlns
.
xmlns:ix="http://www.xbrl.org/2013/inlineXBRL"
But since ix
is the default namespace for the Inline XBRL Specification 1.1, it can be argued that the parser should assume that ix
always belongs to the namespace http://www.xbrl.org/2013/inlineXBRL
, even if this is not defined by the creator of the instance document.
Which datasource are you using for the instance documents?
I currently work primarily with SEC Edgar where I have not yet encountered this problem.
from py-xbrl.
Hello,
I'm experiencing the same issue. The XBRL is from the DTA (Dutch Tax Authority). The XSD schema files are retrieved correctly. Attached is the XBRL but without any data. It seems to be the namespace that the DTA uses, bd-i. If I patch the module file 'instance.py' with the bd-i and iso2417 namespace, it unfortunately doesn't work.
from py-xbrl.
@tedjansen
The file you provided correctly defines both namespaces bd-i
and iso2417
correctly.
However the parser can not find the url of the xml schema that defines the concepts (i.e: where the concept bd-i:ValueAddedTaxPrivateUse
is defined).
I also could only find it via google, the correct schema url is: http://www.nltaxonomie.nl/nt13/bd/20181212/dictionary/bd-data.xsd
XBRL submissions from the SEC always contain a mapping between namespace and schema url in the taxonomy schema.
Honestly I am not quite sure how to get the schema url for the namespace xmlns:bd-i="http://www.nltaxonomie.nl/nt13/bd/20181212/dictionary/bd-data"
in your case because I can't find the mapping from namespace to schema url anywhere in the taxonomy that your file uses 🤔.
from py-xbrl.
In this particular case the parser would just have to add a .xsd
to the namespace to get to the schema url.
However, this is not the normal way to get from a namespace to an xml schema. Or am I missing something in the XML specification?
from py-xbrl.
That seems unfortunately to be the way. I've parsed 4 different types of XBRL files locally (DCIT (Dutch Corporate Income Tax/VPB), DIT (Dutch Income Tax/IB), VAT (OB) and filed accounts (KVK deponering, Dutch GAAP,) but they all give an error when downloading any dictionary from nltaxonomie.nl.
Would love to send in a PR, but I can't follow the exact error to where I should fix it. Besides the point that it seems a bit weird that there should be a reference in the software to supplement .xsd to the NL Taxonomy files. See below an example of a filed account statement with the same reference, but not the bd-i namespace.
from py-xbrl.
I found a mapping between namespace and schema url in the releasenotes of the sbr taxonomie (page 3):
I am not quite sure if it is the best idea to add a fallback where the parser simply tries to add a .xsd
to the namespace, make an http request and check if it was successful.
In my opinion it would be nicer to add the ability to manually pass a dictionary to the parser, where you can define a mapping between namespace and schema url by yourself. This information can normally be found in the taxonomy architecture description.
I will think about how this could be implemented in the next few days.
from py-xbrl.
@tedjansen I was able to parse the file you provided above by manually adding the missing mapping to the ns_schema_map attribute of the taxonomy module. Please install the latest version of py-xbrl (py-xbrl 2.0.3
) and check if it works for you.
import logging
from xbrl.cache import HttpCache
from xbrl.instance import XbrlInstance, XbrlParser
from xbrl.taxonomy import ns_schema_map
cache: HttpCache = HttpCache('./cache')
xbrlParser = XbrlParser(cache)
# add the missing namespace/schema_url mapping
ns_schema_map["http://www.nltaxonomie.nl/nt13/bd/20181212/dictionary/bd-data"] = \
"http://www.nltaxonomie.nl/nt13/bd/20181212/dictionary/bd-data.xsd"
# Todo: replace the file path
xbrl_url = './data/DTA/btw-gh.xml'
inst: XbrlInstance = xbrlParser.parse_instance_locally(xbrl_url)
I know that this is not the prettiest solution but it should work for now.
from py-xbrl.
Thx, that works if the file ends on .xml. The XBRL ends on .xbrl by default in The Netherlands, so the class automatically switches to the ixbrl processing variant. Unfortunately I get the same error, but by renaming it works.
from py-xbrl.
Related Issues (20)
- Need path or reference to source file of a Linkbase HOT 2
- Standardised Financial Data HOT 5
- Equals method for all fact classes HOT 1
- Solution to frequently missing taxonomy specifications in UK submissions HOT 21
- Parsing Failures for Empty Fact Values and 'nil' Text in XBRL Documents HOT 2
- Support a New Taxonomy? HOT 1
- Parsing filings with empty imports HOT 3
- Issue with dateMonthDayYearEN function in Transformation __init__ file HOT 1
- xbrl.TaxonomyNotFound HOT 2
- parse_ixbrl does not close the file it opens HOT 4
- Add support for the ixt-sec transformations. HOT 1
- unresolved schemas HOT 12
- Not well-formed (invalid token) error for ixblr. HOT 11
- parse_ixbrl should add encoding argument HOT 2
- Be nicer to submissions that do not follow the XBRL standard 100% HOT 6
- New 2022 taxonomies HOT 4
- Bug: instance.json('my-file.json') HOT 1
- Unclear +/- sign of some facts HOT 17
- Space in url creates issues when requesting a taxonomy
- Potential arg bug in transformations __init__ HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py-xbrl.