0

I am integrating @JeffFerguson's Gepsio into my project.

I am using Banca d'Italia's SARA XBRL dialect.

In order to validate an XbrlDocument I need all the schemas to be in same directory as the XBRL file. The sample file, in fact, contains a link to the SARA XSD schema

<link:schemaRef xlink:type="simple" xlink:href="t-SARA-2016-03-23.xsd" />

The problem is that I am required to build an application that will accept user-uploaded SARA files (.xml) and I can have the t-SARA-2016-03-23.xsd schema (along with its referenced schemas) in my assembly but not necessarily in the upload/temp directory.

Is there any way to tell Gepsio to load requires XSDs from somewhere else rather than the directory where the XBRL (.xml) file is? I can see there is a constructor that takes System.IO.Stream, which definitely has no knowledge of the file's real path, as it could be in-memory like during an upload (not really.....)

usr-local-ΕΨΗΕΛΩΝ
  • 26,101
  • 30
  • 154
  • 305
  • Hi! Jeff Ferguson here! Currently, the answer is "no", as Gepsio loads schemas with non-absolute (in other words, relative) paths relative to the XBRL instance's path. Gepsio would not know where else to look. Are you suggesting that the loader allow the caller to specify a schema location? Thank you for giving Gepsio a try! – JeffFerguson May 12 '16 at 16:34
  • This is a hack, and I am just thinking out loud, but ... is there any way to modify the elements to specify an absolute path for the "href" before giving the document over to Gepsio? – JeffFerguson May 12 '16 at 16:47
  • Thanks for addressing the issue. Currently I don't know if `System.Xml`'s parser can be configured with a set of XSDs to look for. This is especially important when you load an XML file from a stream rather than from a file. Currently the best approach would be uncompressing XSDs from the assembly to a temporary directory. I'll take a closer look. – usr-local-ΕΨΗΕΛΩΝ May 16 '16 at 08:00

0 Answers0