MapXML 0.1.0-Alpha
See the version list below for details.
dotnet add package MapXML --version 0.1.0-Alpha
NuGet\Install-Package MapXML -Version 0.1.0-Alpha
<PackageReference Include="MapXML" Version="0.1.0-Alpha" />
<PackageVersion Include="MapXML" Version="0.1.0-Alpha" />
<PackageReference Include="MapXML" />
paket add MapXML --version 0.1.0-Alpha
#r "nuget: MapXML, 0.1.0-Alpha"
#:package MapXML@0.1.0-Alpha
#addin nuget:?package=MapXML&version=0.1.0-Alpha&prerelease
#tool nuget:?package=MapXML&version=0.1.0-Alpha&prerelease
MapXML
MapXML is a lightweight .NET library designed for mapping and transforming XML structures into strongly-typed objects and vice-versa. It provides a framework for defining XML structure, resolving types, and performing automated parsing and object instantiation.
Projects
- MapXML — Core library
- MapXML.Samples — Samples collection, still a work in progress
- MapXML.Test — Unit test suite using MSTest
📦 Getting Started
To use MapXML in your project you can either install through NuGet
dotnet add package MapXML
or clone and compile along with your project :
git clone https://github.com/LongJSilver/MapXML.git
Sample Use Case
Below is an example that shows a small XML document and its corresponding C# object graph.
Example XML
<Library>
<Book ISBN="9783161484100">
<Title>The Art of Computer Programming</Title>
<Author>Donald E. Knuth</Author>
<PublishedYear>1968</PublishedYear>
</Book>
<Book ISBN="9780131103627">
<Title>The C Programming Language</Title>
<Author>Brian W. Kernighan & Dennis M. Ritchie</Author>
<PublishedYear>1978</PublishedYear>
</Book>
</Library>
CLR Objects
using System.Collections.Generic;
namespace MapXMLExample
{
public class Library
{
// A collection to hold all Book objects
[XmlChild("Book")]
public List<Book> Books { get; set; } = new List<Book>();
}
public class Book
{
// XML attribute mapped to a property
public string ISBN { get; set; }
// XML child elements mapped to properties
public string Title { get; set; }
public string Author { get; set; }
public int PublishedYear { get; set; }
}
}
Deserialization Code
//Define options
IDeserializationOptions opt =
XMLDeserializer.OptionsBuilder()
.AllowImplicitFields(true) //<-- Allow implicit fields
.Build();
//Create a minimal handler to define the root type
var h = new DefaultHandler();
h.Associate("Library", typeof(Library)); //tell the system what 'Library' nodes should map to
// Create an instance of the XMLDeserializer, assuming the XML is stored in the 'xmlString' variable
XMLDeserializer deserializer = new XMLDeserializer(xmlString, Handler:h, Options:opt);
deserializer.Run();
// Get the results
IReadOnlyList<Library> results = h.GetResults<Library>();
📜 License and notes
MapXML is released under Apache 2.0
Despite being released on NuGet it is in the alpha stage, not stable and still subject to frequent breaking changes.
Feedback, suggestions and contributions are welcome.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on MapXML:
| Package | Downloads |
|---|---|
|
Linea
Flexible multi-platform CLI framework and Console utilities |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.5.3-Beta-debug | 39 | 3/30/2026 |
| 0.5.3-Beta | 34 | 3/30/2026 |
| 0.3.6-Beta-debug | 42 | 1/18/2026 |
| 0.3.6-Beta | 38 | 1/18/2026 |
| 0.3.5-Beta-debug | 45 | 1/8/2026 |
| 0.3.5-Beta | 42 | 1/8/2026 |
| 0.3.4-Beta-debug | 130 | 12/24/2025 |
| 0.3.4-Beta | 129 | 12/24/2025 |
| 0.2.0-Beta | 146 | 5/20/2025 |
| 0.1.0-Alpha | 141 | 4/29/2025 |