BoTech.XmlParser
1.1.0
dotnet add package BoTech.XmlParser --version 1.1.0
NuGet\Install-Package BoTech.XmlParser -Version 1.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="BoTech.XmlParser" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BoTech.XmlParser" Version="1.1.0" />
<PackageReference Include="BoTech.XmlParser" />
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 BoTech.XmlParser --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: BoTech.XmlParser, 1.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 BoTech.XmlParser@1.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=BoTech.XmlParser&version=1.1.0
#tool nuget:?package=BoTech.XmlParser&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
BoTech.XmlParser
- This Xml Parser is a custom xml Parser that supports generics, interfaces and abstract classes.
- The Xml Parser uses internal XmlProperties to achieve this.
_gtfor generics and_nspfor specific namespaces.
Installation
- Just install the following package:
dotnet add package BoTech.XmlParser
Examples usage:
Serialization
// Add missing usings here.
namespace TestSerialization
{
public class Program
{
public static void Main(string[] args)
{
string xml = new XmlSerializer().Serialize(new Employee<int>("First Name, Last Name", 3000));
Console.WriteLine(xml);
}
}
[XmlName("Employee")]
public class Employee<T>(string name, int salary)
{
public string Name {get; set;} = name;
public T Salary {get; set;} = salary;
}
}
Result
<?xml version="1.0" encoding="UTF-8"?>
<Employee Name="First Name, Last Name" Salary="3000" _gt="(_tId:1;_aTId:-1;_tn:Employee`1;_nsp:BoTech.XmlParser.Tests),(_tId:2;_aTId:1;_tn:Int32;_nsp:System)"/>
Deserialization
Xml to deserialize
<?xml version="1.0" encoding="UTF-8"?>
<Employee Name="First Name, Last Name" Salary="3000" _gt="(_tId:1;_aTId:-1;_tn:Employee`1;_nsp:BoTech.XmlParser.Tests),(_tId:2;_aTId:1;_tn:Int32;_nsp:System)"/>
Code:
// Add missing usings here.
namespace TestSerialization
{
public class Program
{
public static void Main(string[] args)
{
Employee<int> employee = (Employee<int>)new XmlDeserializer().Deserialize("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Employee Name=\"First Name, Last Name\" Salary=\"3000\" _gt=\"(_tId:1;_aTId:-1;_tn:Employee`1;_nsp:BoTech.XmlParser.Tests),(_tId:2;_aTId:1;_tn:Int32;_nsp:System)\"/>");
Console.WriteLine(employee.Salary);
}
}
[XmlName("Employee")]
public class Employee<T>
{
public string Name {get; set;}
public T Salary {get; set;}
}
}
| Product | Versions 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 |
|---|---|---|
| 1.1.0 | 100 | 4/22/2026 |
| 1.0.20-beta | 99 | 4/15/2026 |
See github: #1 to #23