Forcing httpsRedirect on namespace references of Instance File when downloading

59 views
Skip to first unread message

Kris

unread,
Apr 1, 2024, 7:08:31 PMApr 1
to Arelle-users
New to xbrl, but having issues resolving 301 redirects when downloading DTS.  Specifically, a few namespaces are listed with http refs but return 301 permanent redirect errors - same URI but with https scheme.

Have some simple code in python to load an instance file, and download the DTS.  I specifically set webCache.httpsRedirect to True but it appears that in modelDocument, even though the load method looks at httpsRedirect when normalizing the URI, it doesn't use that reference when _downloadFile is called - or that there is any 301 or exception handling.

Is there any way to force httpsRedirect on DTS discovery or downloading namespace refs?

Am I thinking about this incorrectly or not understanding something?  Still very new to xbrl so trying to understand how to handle file that don't include the proper scheme in namespace references.

XML file attached.  The following schemaRef are the violators that I am trying to handle/ correct for.

<link:schemaRef xlink:type="simple" xlink:href="http://www.ffiec.gov/xbrl/call/report051/2021-03-31/v229/concepts.xsd"/>

-------
from arelle import Cntlr, ModelManager, ModelXbrl, WebCache #, XbrlConst, XmlUtil
from arelle import Validate

# Local file
xbrl_file = 'src/bank_level/FFIEC CDR Call Bulk XBRL 03312021/FFIEC CDR Call FI 37(ID RSSD) 03312021.xbrl.xml'

# Create a cntlr and model manager instance
cntlr = Cntlr.Cntlr()

# Allow HTTP redirects when importing taxonomies and references
cntlr.webCache.httpsRedirect = True
cntlr.webCache.logDownloads = True

# Load the XBRL instance file
model_xbrl = ModelXbrl.load(cntlr.modelManager, xbrl_file)

# Validate the XBRL instance
validated = Validate.validate(model_xbrl)
FFIEC CDR Call FI 37(ID RSSD) 03312021.xbrl.xml

Herman Fischer

unread,
Apr 1, 2024, 7:19:39 PMApr 1
to arelle...@googlegroups.com

This is an XML spec issue.  When there is an href to an http address that’s the URL hint to find the schema file irregardless of any behind-the-scenes redirect.  A second href explicitly to https would be a different URL.  XML spec does not allow for them to be the same whether the difference is http vs https or realsite.org vs fakesite.org.

 

For filings, as long as the same href to http or https is used consistently in a single filing all will be fine (with 301 redirects), but intermixing href flavors in the same DTS discovery isn’t a good idea.

 

This has been previously discussed in XBRL Base Spec WG, please consider joining.

 

   Herm Fischer

 

--

---
You received this message because you are subscribed to the Google Groups "Arelle-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arelle-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/arelle-users/e0de1f1c-27e9-4d01-8fa3-994ca402ba8cn%40googlegroups.com.

Kris

unread,
Apr 26, 2024, 1:44:47 PMApr 26
to Arelle-users
Thanks, that is helpful.  Was going to to try to understand possible paths to get around this resolution issue, but might be helpful to take a step back initially. 

In trying to just load the instance file and then locally load the taxonomy and schema (individual files since it's not a proper taxonomy zip package) into ArelleGUI, I can't get the Fact List to load/show.  I'm fairly new to XBRL so don't really understand if it's user error or something else is the culprit here.  Any thoughts or help in getting FFIEC data to display?

Attached is the sample instance and taxonomy (not a proper taxonomy package).

Screenshot 2024-04-26 at 1.42.42 PM.png

Taxonomies>

Call Reports (Instance Files)>



Call_ 12312023_Form041.zip
Call_Cert57269_12312023.XBRL
Reply all
Reply to author
Forward
0 new messages