Reading iXbrl Taxonomies locally - XbrlException thrown

I have code as below. It’s more or less same code as in documentation, with difference being enabling of LocalCacheService.

const string ixbrlPath = @"..\cache\www.akerhorizons.com\20231231\ah-2023-12-31.xhtml";
const string outputPath = @"..\output\";

LocalCacheService.EnableService(@"..\cache");
var isCacheEnabled = LocalCacheService.Enable;

InlineXbrlDocument document = new InlineXbrlDocument(ixbrlPath);

I was trying to run the code but it fails with exception being:
“Aspose.Finance.Xbrl.XbrlException: Can't find http://www.akerhorizons.com/20231231/ah-2023-12-31.xsd

I wish to run my taxonomies from local folder, I thought that creating ‘cache’ folder and putting all needed files there with Enabling LocalCacheService would solve my problem (as in py-xbrl library for example), yet it fails and still tries to connect to non-existent address. Is there any way that I can read files locally?

@Mrozixshoe

It seems that you are encountering an XbrlException when trying to read an iXBRL document locally, specifically with the error message indicating that it cannot find the XSD file at the specified URL. This issue often arises when the application is unable to locate the necessary schema files that are referenced within the iXBRL document.

To resolve this issue, ensure that the LocalCacheService is correctly set up and that all required files, including the XSD schema files, are present in the specified cache directory. Here are some steps you can follow:

  1. Verify Cache Directory: Make sure that the cache directory (..\cache) contains all the necessary files, including the XSD files that your iXBRL document references. The structure should mirror the expected paths as defined in the iXBRL document.

  2. Enable LocalCacheService: You have already enabled the LocalCacheService, which is good. Ensure that this line is executed before you instantiate the InlineXbrlDocument object.

  3. Check File Paths: Double-check the paths in your iXBRL document to ensure they are correctly pointing to the local files. If the paths are absolute URLs, you may need to modify them to point to the local cache.

  4. Sample Code: Here’s a simplified version of how you might set up your code:

    const string ixbrlPath = @"..\cache\www.akerhorizons.com\20231231\ah-2023-12-31.xhtml";
    LocalCacheService.EnableService(@"..\cache");
    
    InlineXbrlDocument document = new InlineXbrlDocument(ixbrlPath);
    
  5. Testing with Different Files: If the issue persists, try testing with a different iXBRL file that you know works with the library to determine if the problem is specific to the file you are using.

If you continue to experience issues, it may be beneficial to check for updates or patches for the Aspose.Finance library, as there have been reports of similar issues being addressed in recent updates.

For further assistance, you might want to refer to the official documentation on reading iXBRL documents, which provides detailed guidance on the process and requirements.

Sources:
[1]: Read iXBRL Document | Aspose.Finance .NET API
[2]: XBRL File Reading | Aspose.Finance .NET API

I already tested with other files, double-checked file paths and issue still persists. Sample code you provided is basically the same as in post

@Mrozixshoe,

Could you please zip and attach “ah-2023-12-31.xhtml” file. We will check your issue soon.

Sure thing. As the file size is too large I’m sending the link to Google Drive, I’ve uploaded whole cache folder, with schema file and linkbases. Maybe it’ll help you better:

@Mrozixshoe,

Thanks for the sample XBRL file with dependencies.

After initial testing, I was able to reproduce the issue as you mentioned by using your sample XBRL file. I found the “XbrlException - Can't find http://www.akerhorizons.com/20231231/ah-2023-12-31.xsd” when reading iXbrl Taxonomies.

We require thorough evaluation of the issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): FINANCENET-382

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Thank you for swift response!
As I’m still considering options for my business - Aspose being one of them I’d like to keep working with it (I’m even considering getting paid support later, if product meets our needs) so I’d like to ask about alternative solutions that might work until the issue is fixed. Can you kindly provide any please?

@Mrozixshoe,

We kindly request you to spare little time to thoroughly assess your issue. We will then provide an update and explore potential temporary workarounds. If the issue is complex, we can also provide an estimated time frame for resolution. We aim to get back to you with more updates soon.

@Mrozixshoe
I have checked your document and you can try changing the link here to a local address. If there are any problems later, please contact me promptly.
38e66f0c-26c1-4aa0-a3c6-9f9ba0785d14.png (13.1 KB)