Loading XBRL Instances - JeffFerguson/gepsio GitHub Wiki
The first step in working with Gepsio is to load an existing XBRL instance. To do this, simply create a new XbrlDocument object and call its Load() method, supplying the path to the XBRL instance as a parameter:
var xbrlDoc = new XbrlDocument();
xbrlDoc.Load(@"..\..\JeffFerguson.Gepsio.Test\XBRL-CONF-2014-12-10\Common\300-instance\301-01-IdScopeValid.xml");
Gepsio also accepts URLs to document instances:
var xbrlDoc = new XbrlDocument();
xbrlDoc.Load("http://xbrlsite.com/US-GAAP/BasicExample/2010-09-30/abc-20101231.xml");
The only file that you need to specify in the call to Load() is the name of the XBRL document. Gepsio will automatically discover and load all of the related documents, such as schemas and linkbase documents. Your code does not have to specify the location of any of those ancillary documents, since Gepsio will find and load them automatically for you.
using JeffFerguson.Gepsio;
namespace Load
{
class Program
{
static void Main(string[] args)
{
LoadFromLocalFile();
LoadFromUrl();
}
static void LoadFromLocalFile()
{
var xbrlDoc = new XbrlDocument();
xbrlDoc.Load(@"..\..\..\..\..\..\JeffFerguson.Gepsio.Test\XBRL-CONF-2014-12-10\Common\300-instance\301-01-IdScopeValid.xml");
}
static void LoadFromUrl()
{
var xbrlDoc = new XbrlDocument();
xbrlDoc.Load("http://xbrlsite.com/US-GAAP/BasicExample/2010-09-30/abc-20101231.xml");
}
}
}
Imports JeffFerguson.Gepsio
Module Program
Sub Main(args As String())
LoadFromLocalFile()
LoadFromUrl()
End Sub
Private Sub LoadFromUrl()
Dim xbrlDoc = New XbrlDocument()
xbrlDoc.Load("http://xbrlsite.com/US-GAAP/BasicExample/2010-09-30/abc-20101231.xml")
End Sub
Private Sub LoadFromLocalFile()
Dim xbrlDoc = New XbrlDocument()
xbrlDoc.Load("..\..\..\..\..\..\JeffFerguson.Gepsio.Test\XBRL-CONF-2014-12-10\Common\300-instance\301-01-IdScopeValid.xml")
End Sub
End Module
open JeffFerguson.Gepsio
let LoadFromLocalFile =
let xbrlDoc = new XbrlDocument()
xbrlDoc.Load @"..\..\..\..\..\..\JeffFerguson.Gepsio.Test\XBRL-CONF-2014-12-10\Common\300-instance\301-01-IdScopeValid.xml"
let LoadFromUrl =
let xbrlDoc = new XbrlDocument()
xbrlDoc.Load "http://xbrlsite.com/US-GAAP/BasicExample/2010-09-30/abc-20101231.xml"
[<EntryPoint>]
let main argv =
LoadFromLocalFile
LoadFromUrl
0 // return an integer exit code
Add-Type -Path '..\..\JeffFerguson.Gepsio\bin\Debug\netstandard2.0\JeffFerguson.Gepsio.dll'
function LoadFromLocalFile()
{
$ScriptDir = Split-Path $script:MyInvocation.MyCommand.Path
$xbrlDoc = new-object "JeffFerguson.Gepsio.XbrlDocument"
$xbrlDoc.Load($ScriptDir + '..\..\..\JeffFerguson.Gepsio.Test\XBRL-CONF-2014-12-10\Common\300-instance\301-01-IdScopeValid.xml')
}
function LoadFromUrl()
{
$xbrlDoc = new-object "JeffFerguson.Gepsio.XbrlDocument"
$xbrlDoc.Load('http://xbrlsite.com/US-GAAP/BasicExample/2010-09-30/abc-20101231.xml')
}
LoadFromLocalFile
LoadFromUrl