WebException Objects and XBRL Schema Object Creation

The other day, I was doing some performance testing in Gepsio and noticed that HTTP errors found during the XBRL schema object creation process were not reported in the same way as other exceptions thrown by Gepsio.

The constructor of Gepsio’s XbrlSchema class uses an XmlTextReader to read an XBRL schema. If the URI for the XBRL schema to be read is an HTTP-based URI, then the XmlTextReader will use the .NET Web stack to read the schema using HTTP. If something fails during that process, the .NET Web stack will throw a WebException.

In the Nov 2011 CTP (and, in fact, all Gepsio CTPs to this point), thrown WebException objects were not wrapped in an XbrlException object and were consequently thrown back to the client as a WebException object.

To be clear that the issue is an XBRL issue caused by an HTTP failure, the XBRL schema creation code now creates an XbrlException object, stores the caught WebException as an inner exception to the XbrlException, and throws the XbrlException object back up to the client.

I have just checked in a fix for the issue. The fix will be available in the next release (currently planned for Jul 2012). If you want to grab the code ahead of time, feel free to grab the latest source code here.

Unsupported Path Bug Fixed in Linkbase Document Class

Codeplex (and Gepsio) user matthewschrager recently submitted a patch for a rather old issue that caused paths of the form “file:///C:/blah/blah/http://blah/blah.org” to be created in the LinkbaseDocument class’ GetFullLinkbasePath() method when filings that reference remote documents are stored locally. This caused a NotSupportedException to be thrown.

I have just applied this patch and have checked in a fix for the issue. The fix will be available in the next release (currently planned for Jul 2012). If you want to grab the code ahead of time, feel free to grab the latest source code here.

Many thanks to matthewschrager for sending in a patch!

Null Reference Bug Fixed in QualifiedName Class

Codeplex (and Gepsio) user jwokelly recently filed a bug noting that the Gepsio Nov 2011 CTP was failing to parse the XBRL documents created by Amazon to report their financial information for Q1 2012. More specifically, Gepsio was throwing a NullReferenceException while attempting to perform equality comparisons in the qualified name code.

I have just fixed this bug and have checked in a fix. The fix will be available in the next release (currently planned for Jul 2012). If you want to grab the code ahead of time, feel free to grab the latest source code here.

Many thanks to jwokelly for reporting a bug and for sending along the offending documents in a ZIP file. Gepsio now includes a unit test that parses these documents and ensures that no exceptions are thrown.

Full Documentation Available for the Nov 2011 CTP

The first release of help file-style documentation for Gepsio is now available for the Nov 2011 CTP! To grab your copy, go to the Nov 2011 CTP Release page here and download the JeffFerguson.Gepsio.chm file.

If you download the file directly, and save it to a location such as your Desktop, you may get an “Navigation to the webpage was canceled” message when you open it:


To fix this, close the CHM file.Then find the downloaded CHM file, right click it, and select “Properties” from the context menu. You will see the file’s Properties dialog:


If you see the message at the bottom that reads “This file came from another computer and might be blocked to help protect this computer”, click the “Unblock” button. Click the “OK” button to close the Properties dialog, and reopen the CHM file.



This online documentation is generated automatically from comments I embed in the source code. The nice part about that is that, as I update the source code comments and produce new builds, the online documentation will be updated and synchronized with the latest information available in the Gepsio object model.

Gepsio Reviewed by HereBeDragon

I found a very nice review of Gepsio today on a blog at herebedragon.blogspot.com. Here’s what the author had to say:

My first stop was Codeplex, where I searched for the term ‘XBRL’ and found 3 projects. That’s too few. Of these, one particularly caught my eye (in fact I have followed this project for a few months) and that is ‘Gepsio’.

Gepsio is a .NET based document object model for XBRL that can load and validate XBRL documents. It’s a ‘strict’ processor for XBRL that throws exceptions when the loaded document is not valid. Perhaps it’s possible to make changes to and save XBRL files using Gepsio as well, but frankly I could not look into it in depth because of the exceptions and because I was short of time.

I did give the source code of the XBRL Reader part of Gepsio a good look though. I was impressed to see sustained work, focus on meeting XBRL conformance requirements and a clean, well organized codebase. Gepsio is a good option to evaluate if you are looking for open source XBRL software.

The Gepsio XBRL code is licensed under Microsoft Public License (Ms-PL), which allows you to use the code in a commercial application.

Find the author’s review of Gepsio, and many other open source XBRL tools, through this link.

Thanks to HereBeDragon for the review!

Documentation Work in Progress

I am currently working on providing some online help for Gepsio:


I am currently adding XML comments to all of the public classes, properties and methods so that I can use Sandcastle to generate CHM-style documentation. The XML comments should also aid in providing documentation to Visual Studio’s Intellisense infrastructure.

I realize that Gepsio’s growing array of public classes and properties can be daunting and I hope that this documentation will go a long away towards making its public interface understandable.