Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #34. Target both netstandard2.0 and netstandard2.1 frameworks… #35

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CS-Load-Net48/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>
59 changes: 59 additions & 0 deletions CS-Load-Net48/CS-Load-Net48.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0ECD24DE-FDBB-4B5D-A59E-4B2C24401095}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>CS_Load_Net48</RootNamespace>
<AssemblyName>CS-Load-Net48</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\JeffFerguson.Gepsio\JeffFerguson.Gepsio.csproj">
<Project>{113daa29-48e6-4102-8519-21841817717b}</Project>
<Name>JeffFerguson.Gepsio</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
25 changes: 25 additions & 0 deletions CS-Load-Net48/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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");
}
}
}
36 changes: 36 additions & 0 deletions CS-Load-Net48/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// Les informations générales relatives à un assembly dépendent de
// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
// associées à un assembly.
[assembly: AssemblyTitle("CS-Load-Net48")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CS-Load-Net48")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly
// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de
// COM, affectez la valeur true à l'attribut ComVisible sur ce type.
[assembly: ComVisible(false)]

// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
[assembly: Guid("0ecd24de-fdbb-4b5d-a59e-4b2c24401095")]

// Les informations de version pour un assembly se composent des quatre valeurs suivantes :
//
// Version principale
// Version secondaire
// Numéro de build
// Révision
//
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
// en utilisant '*', comme indiqué ci-dessous :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
7 changes: 7 additions & 0 deletions Gepsio.sln
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "VB-ValidityChecks", "Exampl
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FS-ValidityChecks", "Examples\FSharp\FS-ValidityChecks\FS-ValidityChecks.fsproj", "{240ACE45-827F-4BF4-A8B2-A665F60543D4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CS-Load-Net48", "CS-Load-Net48\CS-Load-Net48.csproj", "{0ECD24DE-FDBB-4B5D-A59E-4B2C24401095}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -109,6 +111,10 @@ Global
{240ACE45-827F-4BF4-A8B2-A665F60543D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{240ACE45-827F-4BF4-A8B2-A665F60543D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{240ACE45-827F-4BF4-A8B2-A665F60543D4}.Release|Any CPU.Build.0 = Release|Any CPU
{0ECD24DE-FDBB-4B5D-A59E-4B2C24401095}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0ECD24DE-FDBB-4B5D-A59E-4B2C24401095}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0ECD24DE-FDBB-4B5D-A59E-4B2C24401095}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0ECD24DE-FDBB-4B5D-A59E-4B2C24401095}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -130,6 +136,7 @@ Global
{7BE7AC00-EE8A-443E-B4A7-513586C967C7} = {7455EAEB-9C1A-45FD-A081-995D03D3928B}
{4466F96A-BA67-4AF1-99E4-42B0196CE126} = {2B52986E-F25A-4D24-AE8D-030E0D30000B}
{240ACE45-827F-4BF4-A8B2-A665F60543D4} = {E85AD6CE-FD56-4964-B6B6-27155121CC06}
{0ECD24DE-FDBB-4B5D-A59E-4B2C24401095} = {BF2C0A53-F1C4-4F35-9C9A-E0216745A023}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {66D6765D-440E-4A82-BC6E-0628A4A0618C}
Expand Down
10 changes: 6 additions & 4 deletions JeffFerguson.Gepsio/JeffFerguson.Gepsio.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>Gepsio</PackageId>
<Version>2.1.0.17</Version>
Expand All @@ -20,11 +20,13 @@
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\net6.0\JeffFerguson.Gepsio.xml</DocumentationFile>
<DocumentationFile>JeffFerguson.Gepsio.xml</DocumentationFile>
<OutputPath>bin\Debug</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\net6.0\JeffFerguson.Gepsio.xml</DocumentationFile>
<DocumentationFile>JeffFerguson.Gepsio.xml</DocumentationFile>
<OutputPath>bin\Release</OutputPath>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 4 additions & 2 deletions JeffFerguson.Gepsio/XbrlDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ public void Load(string Filename)
}
}

#if NETSTANDARD2_1
/// <summary>
/// Synchronously load a document directly from the SEC Web site.
/// </summary>
Expand Down Expand Up @@ -293,7 +294,7 @@ public async Task LoadAsync(string Filename)
Parse(SchemaValidXbrl);
}
}

#endif
/// <summary>
/// Synchronously loads an XBRL document containing XBRL data from a stream.
/// </summary>
Expand Down Expand Up @@ -376,6 +377,7 @@ public void Load(Stream dataStream)
this.Path = string.Empty;
Parse(SchemaValidXbrl);
}
#if NETSTANDARD2_1

/// <summary>
/// Asynchronously loads an XBRL document containing XBRL data from a stream.
Expand Down Expand Up @@ -459,7 +461,7 @@ public async Task LoadAsync(Stream dataStream)
this.Path = string.Empty;
Parse(SchemaValidXbrl);
}

#endif
/// <summary>
/// Determines whether or not a URI references the SEC Web site.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public void Load(Stream stream)
doc = XDocument.Load(stream, LoadOptions.SetBaseUri);
}

#if NETSTANDARD2_1
public async Task LoadAsync(string path)
{
if(File.Exists(path))
Expand Down Expand Up @@ -69,7 +70,7 @@ public async Task LoadAsync(Stream stream)
var cancelToken = new CancellationToken();
doc = await XDocument.LoadAsync(stream, LoadOptions.SetBaseUri, cancelToken);
}

#endif
public INodeList SelectNodes(string xpath, INamespaceManager namespaceManager)
{
var selectedElements = doc.XPathSelectElements(xpath, (namespaceManager as NamespaceManager).XmlNamespaceManager);
Expand Down
3 changes: 2 additions & 1 deletion JeffFerguson.Gepsio/Xml/Interfaces/IDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public interface IDocument
/// </param>
void Load(Stream stream);

#if NETSTANDARD2_1
/// <summary>
/// Loads an XBRL document asynchronously.
/// </summary>
Expand All @@ -52,7 +53,7 @@ public interface IDocument
/// A stream containing the XBRL data to be loaded.
/// </param>
Task LoadAsync(Stream stream);

#endif
/// <summary>
/// Select a set of nodes from the document.
/// </summary>
Expand Down