XSDService 1.3.0

Suggested Alternatives

ISO20022.XSD

There is a newer version of this package available.
See the version list below for details.
dotnet add package XSDService --version 1.3.0                
NuGet\Install-Package XSDService -Version 1.3.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="XSDService" Version="1.3.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add XSDService --version 1.3.0                
#r "nuget: XSDService, 1.3.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install XSDService as a Cake Addin
#addin nuget:?package=XSDService&version=1.3.0

// Install XSDService as a Cake Tool
#tool nuget:?package=XSDService&version=1.3.0                

Xsd To Json Converter

Nuget

This will help to convert any XSD to JSON

Install package

  1. Install the XSDService NuGet package.
  • .NET CLI
  dotnet add package XSDService --version 1.1.4
  • PackageManager
Install-Package XSDService -Version 1.1.4

Usage

using XSDService;

var fileInfo = new FileInfo(fileName);
if (File.Exists(fileName) && fileInfo.Extension.Equals(".xsd"))
{
    XsdToJson xsdLib = new(fileName);
    xsdLib.Convert();
    File.AppendAllText(fileInfo.FullName.Replace(".xsd", ".json"), xsdLib.SchemaJson);
}

Model of JSON

public class XsdSchema
{
    public string Namespace { get; set; }
    public SchemaElement SchemaElement { get; set; }
}

public class SchemaElement
{
    
    public string Id { get; set; }
    public string Name { get; set; }
    public string DataType { get; set; }
    public string MinOccurs { get; set; }
    public string MaxOccurs { get; set; }
    public string MinLength { get; set; }
    public string MaxLength { get; set; }
    public string Pattern { get; set; }
    public string FractionDigits { get; set; }
    public string TotalDigits { get; set; }
    public string MinInclusive { get; set; }
    public string MaxInclusive { get; set; }
    public string[] Values { get; set; }
    public bool IsCurrency { get; set; }
    public string XPath { get; set; }
    public List<SchemaElement> Elements { get; set; }
}

Example

{
    "namespace": "urn:iso:std:iso:20022:tech:xsd:camt.053.001.10",
    "schemaElement": {
        "id": "Document",
        "name": "Document",
        "dataType": null,
        "minOccurs": "1",
        "maxOccurs": null,
        "minLength": null,
        "maxLength": null,
        "pattern": null,
        "fractionDigits": null,
        "totalDigits": null,
        "minInclusive": null,
        "maxInclusive": null,
        "values": null,
        "isCurrency": false,
        "xpath": "Document",
        "elements":[
          ...
        ]
    }
}

Changes

Version 1.3.0 release

  • New output model.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.