An open-source XBRL processor for business rules, rendering and custom data reporting. See https://xbrl.us/xule for documentation and https://xbrl.us/xule-editor for a VS Code syntax highlighter.
Apache License 2.0
24
stars
10
forks
source link
get role-description and arcrole-description from object's parent model #9
Attributes .role-description and .description not returning the correct value for roles of a taxonomy loaded as a second taxonomy using taxonomy(...) in the rule (after an initial taxonomy was loaded), indicating that the values for these attritbutes are being retrieved from the initial taxonomy loaded only, resulting in incorrect value or incorect none value.
Reason for the issue
In XuleProperties.py, functions property_role, property_role_uri, property_arcrole, passes xule_context.model to role_uri_to_model_role and arcrole_uri_to_model_role. The xule_context.model does not seem to be updated to reflect the modelXbrl in the current scope, the functions always pass the initially loaded modelXbrl, which is fine until a new taxonomy is loaded via taxonomy(...) then the model passed must be the correct model for the current scope.
Suggested Changes
Get the correct modelXbrl from the model object itself before passing it to the conversion functions. This relys on Arelle Cntlr keeping track of which object relates to which parent model, which is very reliable in my experience.
You may want to keep track of the model in scope another way, this is why this is a draft pr just to pinpoint the issue.
Testing
Same as in issue #8, check for a role that exists only in ESEF 2021 loaded using taxonomy(...) after initially loading ESEF 2019.
Steps to test
Before applying the changes in this pr
Save following rule to file test.xule:
constant $other_taxonomy_networks = taxonomy('http://www.esma.europa.eu/taxonomy/2021-03-24/esef_all.xsd')
.networks(none, "http://www.esma.europa.eu/xbrl/role/all/ifrs_17_role-836600o")
output get-from-network-level
for ($nw in $other_taxonomy_networks)
dict(
list("Role", $nw.role),
list("Role description Network attr", $nw.role-description),
list("Role description (Role attr)", $nw.role.description)
) /* Just to print it out in a readable format*/
output get-from-networks-level
list("\nRole description (Networks attr): {string($other_taxonomy_networks.role-description.to-set())}\n---------------\n")[1]
This pr tries to resolve #8
Issue
Attributes
.role-description
and.description
not returning the correct value for roles of a taxonomy loaded as a second taxonomy usingtaxonomy(...)
in the rule (after an initial taxonomy was loaded), indicating that the values for these attritbutes are being retrieved from the initial taxonomy loaded only, resulting in incorrect value or incorect none value.Reason for the issue
In XuleProperties.py, functions
property_role
,property_role_uri
,property_arcrole
, passesxule_context.model
torole_uri_to_model_role
andarcrole_uri_to_model_role
. Thexule_context.model
does not seem to be updated to reflect the modelXbrl in the current scope, the functions always pass the initially loaded modelXbrl, which is fine until a new taxonomy is loaded viataxonomy(...)
then the model passed must be the correct model for the current scope.Suggested Changes
Get the correct modelXbrl from the model object itself before passing it to the conversion functions. This relys on Arelle Cntlr keeping track of which object relates to which parent model, which is very reliable in my experience.
You may want to keep track of the model in scope another way, this is why this is a draft pr just to pinpoint the issue.
Testing
Same as in issue #8, check for a role that exists only in ESEF 2021 loaded using
taxonomy(...)
after initially loading ESEF 2019.Steps to test
Before applying the changes in this pr Save following rule to file test.xule:
Run using the following command (loads ESEF 2019)
The role description is not detected, the ouput should be as follows:
After applying the changes in this pr Run the same exact test above, the role description is detected and the output should be as follows: