MetronInfo.Xml 0.1.0

dotnet add package MetronInfo.Xml --version 0.1.0
                    
NuGet\Install-Package MetronInfo.Xml -Version 0.1.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="MetronInfo.Xml" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MetronInfo.Xml" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="MetronInfo.Xml" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MetronInfo.Xml --version 0.1.0
                    
#r "nuget: MetronInfo.Xml, 0.1.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.
#:package MetronInfo.Xml@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MetronInfo.Xml&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=MetronInfo.Xml&version=0.1.0
                    
Install as a Cake Tool

MetronInfo.Xml

CI

A .NET library for reading and writing MetronInfo.xml files — the comic/manga metadata format described by MetronInfo.xsd.

Installation

Not yet published to NuGet.org. Once released:

dotnet add package MetronInfo.Xml

Requirements

  • .NET 10 SDK

Project layout

MetronInfo.slnx
MetronInfo.xsd                       # schema, embedded into the library for validation
src/MetronInfo.Xml/                  # the library
  MetronInfoXml.cs                   # Read / Write / Validate entry points
  Models/                            # POCOs mapped 1:1 to the XSD's types
tests/MetronInfo.Xml.Tests/          # xUnit tests, including a real MetronInfo.xml fixture

Build & test

dotnet build
dotnet test

Usage

Reading

using MetronInfo.Xml;

MetronInfo.Xml.Models.MetronInfo info = MetronInfoXml.Read("MetronInfo.xml");

Console.WriteLine(info.Series.Name);
Console.WriteLine(info.Number);

Read also has overloads for a Stream or TextReader.

Writing

var info = new MetronInfo.Xml.Models.MetronInfo
{
    Series = new SeriesType { Name = "Sandman", Volume = 1, StartYear = 1989 },
    Number = "1",
    AgeRating = AgeRatingType.Mature,
};

MetronInfoXml.Write(info, "MetronInfo.xml");

Write also has overloads for a Stream or TextWriter. Optional elements and attributes you leave unset are simply omitted from the output.

Write emits the same xmlns:metroninfo, xmlns:xsd, xmlns:xsi, and xsi:schemaLocation attributes that Metron's own tooling writes, so output stays interoperable with other readers even though the schema itself declares no target namespace.

Validating

IReadOnlyList<string> errors = MetronInfoXml.Validate("MetronInfo.xml");

if (errors.Count > 0)
{
    foreach (var error in errors)
    {
        Console.WriteLine(error);
    }
}

Validate checks the document against the embedded copy of MetronInfo.xsd. It also separately enforces the "at most one primary=\"true\"" rules on IDS/ID and URLs/URL — the schema expresses these as XSD 1.1 xs:assert rules, which .NET's built-in XSD 1.0 validator cannot evaluate on its own.

Notes

  • Models live under the MetronInfo.Xml.Models namespace and mirror the schema's element and attribute names.
  • xs:gYear (Series.StartYear) is modeled as int.
  • xs:date fields (CoverDate, StoreDate) and the xs:dateTime field (LastModified) are modeled as DateTime?.

License

GPL-3.0

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.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.

Version Downloads Last Updated
0.1.0 54 8/5/2026