EricksonLopez.Xml
dotnet-xml · Mapping & Serialization
On this page (20 sections)
1. Identity, Tier & Maturity Profile#
2. Value Proposition & Problem Solved#
High-performance XSD validation engine with Anti-XXE defaults, thread-safe precompiled schema cache, Result-based errors, and Native AOT support for modern .NET.
Default legacy BCL XML APIs risk XXE injection and throw expensive XmlSchemaValidationException stack unwinds on invalid payloads.
3. Quick Install#
Primary package: EricksonLopez.Xml.Validation
dotnet add package EricksonLopez.Xml.Validation --version 1.0.0<PackageReference Include="EricksonLopez.Xml.Validation" Version="1.0.0" /><PackageVersion Include="EricksonLopez.Xml.Validation" Version="1.0.0" />4. Verified Ecosystem Metrics#
Snapshot retrieved UTC: 2026-12-01
5. When to Use & When Not to Use#
When to use
- You validate XML documents against precompiled XSD schemas with Anti-XXE defaults, line/column diagnostics, and Result<bool> outputs.
When NOT to use
- You are serializing/deserializing JSON payloads—use System.Text.Json source generation.
6. Core Capabilities & Design Invariants#
Anti-XXE & Precompiled Schema Cache
Enforces DtdProcessing.Prohibit and XmlResolver=null with ConcurrentDictionary-backed IXmlSchemaCache.
Multi-Modal Input & Result<bool>
Validates string, Stream, and ReadOnlySpan<byte> inputs returning Result<bool> with IXmlLineInfo coordinates.
7. Included NuGet Packages & Adapters#
| Package ID | Status | NuGet / Local | TFMs | AOT Status | Downloads | Description |
|---|---|---|---|---|---|---|
| EricksonLopez.Xml.ValidationPrimary | Published | v1.0.0 / v2.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 257 | XSD schema validation engine with Anti-XXE protection, precompiled schema cache, structured Result<T> errors, and Microsoft DI integration for .NET. |
8. Quick Start Code Example#
Grounded in verified public APIs from EricksonLopez.Xml. Compile with `<ImplicitUsings>disable</ImplicitUsings>` and explicit imports.
using EricksonLopez.Xml.Validation;
var cache = new XmlSchemaCache();
cache.RegisterSchema(
"https://example.com/orders",
"<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='https://example.com/orders' />");
var validator = new XmlSchemaValidator(cache);9. Architecture & Dependency Flow#
Rendering diagram…
flowchart LR lib_xml["EricksonLopez.Xml (L3)"] lib_result["EricksonLopez.Result (L0)"] lib_xml --> lib_result
View accessible text summary and structure
1 upstream library dependencies and 0 downstream dependent libraries verified in dependencies.json.
| Direction | Library | Tier | Relationship Kinds |
|---|---|---|---|
| Upstream | EricksonLopez.Result | L0 | Compile-Time, NuGet Package |
flowchart LR
lib_xml["EricksonLopez.Xml (L3)"]
lib_result["EricksonLopez.Result (L0)"]
lib_xml --> lib_result10. Target Frameworks & Native AOT / Trimming Matrix#
MSBuild `.csproj` inspection across 1 packages: 1 Full, 0 Partial, 0 Incompatible, 0 NotApplicable (analyzers/generators).
| Package ID | IsAotCompatible | EnableTrimAnalyzer | Verified AOT Status | Target Frameworks |
|---|---|---|---|---|
| EricksonLopez.Xml.Validation | true | true | Full | net8.0, net9.0, net10.0 |
11. Upstream Dependencies & Downstream Dependents#
Upstream Dependencies (1)
Downstream Dependents (0)
No other EricksonLopez.* libraries currently depend on this family.
12. Optional Adapters & Third-Party Integrations#
Internal Adapter Edges & Integration Packages
No optional cross-family adapter edges or integration packages are recorded for this library.
Verified External NuGet Dependencies (3)
13. Configuration & DI Registration Summary#
Verified DI & Configuration Entry Points
XmlValidationServiceCollectionExtensions.AddXmlValidationRegisters `IXmlSchemaCache` and `IXmlSchemaValidator` as singletons using default `XmlValidationOptions`.
Key Public Types & Contracts
EricksonLopez.Xml.Validation.IXmlSchemaCache (interface)Defines a thread-safe registry and cache for precompiled XSD schema sets.
EricksonLopez.Xml.Validation.IXmlSchemaValidator (interface)Defines a contract for validating XML documents against precompiled XSD schemas with Anti-XXE enforcement.
EricksonLopez.Xml.Validation.XmlSchemaCache (class)Provides a thread-safe cache for precompiled XSD schema sets with Anti-XXE protection.
EricksonLopez.Xml.Validation.XmlSchemaCacheExtensions (class)Provides extension methods for `IXmlSchemaCache` to support registration of XML schemas from the file system.
EricksonLopez.Xml.Validation.XmlSchemaValidator (class)Validates XML documents against precompiled XSD schemas while enforcing Anti-XXE protection and structured validation results.
EricksonLopez.Xml.Validation.XmlValidationOptions (class)Specifies configuration options for XML schema validation behavior.
EricksonLopez.Xml.Validation.XmlValidationServiceCollectionExtensions (class)Provides extension methods for `IServiceCollection` to register XML schema validation services and caching components.
14. Verified Performance Benchmarks#
All verified measurements below come strictly from `BenchmarkDotNet.Artifacts` running on .NET RyuJIT (0 NativeAOT benchmark runs exist in this snapshot).
| Suite | Method | Runtime | Mean (ns) | Allocated (B) | Status |
|---|---|---|---|---|---|
| XmlValidationBenchmarks | CacheLookupContainsSchema | .NET 10.0.11 X64 RyuJIT x86-64-v4 | 6.265 | 0 | measured |
| XmlValidationBenchmarks | ValidateFromString | .NET 10.0.11 X64 RyuJIT x86-64-v4 | 3,055.291 | 75,662 | measured |
| XmlValidationBenchmarks | ValidateFromSpan | .NET 10.0.11 X64 RyuJIT x86-64-v4 | 3,173.613 | 108,593 | measured |
| XmlValidationBenchmarks | ValidateFromStream | .NET 10.0.11 X64 RyuJIT x86-64-v4 | 3,222.165 | 108,514 | measured |
15. Release History & NuGet vs Repo Status#
Version lag detected: NuGet.org latest published version is v1.0.0, while local repository HEAD is at v2.0.0.
| Version | Source | Published Date | Summary |
|---|---|---|---|
| v1.0.0 ↗ | github | 2026-09-23 | Ecosystem Packages in this release | Package | Version | |---------|---------| | `EricksonLopez.Xml.Validation` | `1.0.0` | --- For detailed changes, see [CHANGELOG.md](https://github.com/ericksonlopezf/dotnet-xml/blob/v1.0.0/CHANGELOG.md). |
| v1.0.0 ↗ | nuget | 2026-09-23 | Published EricksonLopez.Xml.Validation 1.0.0 to NuGet.org. |
16. Complementary & Related Libraries#
Libraries in the same tier, architectural layer, or directly paired via dependency edges.
17. Documentation, API Reference & Portal Links#
Conceptual Documentation (Starlight) →
Extracted XML API Reference →
1 namespaces · 7 types · 34 members
Ecosystem Dependency Map →
Learning Center & Handbook →
Per-library conceptual Starlight pages expand in M4; API Reference pages expand in M3.2.
18. Source Repository, License & Contributing#
Released under the MIT License. All assemblies follow EricksonLopez.* build invariants: explicit imports, strong-name signing (`EricksonLopez.snk`), and ASCII author metadata (`Erickson Lopez`).
19. Troubleshooting, Pitfalls & Migration Guidance#
- Primary package ID is `EricksonLopez.Xml.Validation` (there is no root `EricksonLopez.Xml` NuGet package).
- Version lag detected: NuGet.org latest published version is v1.0.0, while local repository HEAD is at v2.0.0.
20. Quality & Verification Evidence#
- Strong-Name Signing (`EricksonLopez.snk`)
- EricksonLopez.snk
- `ImplicitUsings=disable`
- disable
- XML Documentation Extraction
- Verified (1 namespaces, 7 types, 34 members)
- MSBuild AOT / Trim Attributes
- 1 Full / 0 Partial / 0 Incompatible / 0 N/A
- BenchmarkDotNet Artifacts
- 4 total (4 measured, 0 na_error)
Explicit Verification Boundaries & Limitations
- All verified measurements below come strictly from `BenchmarkDotNet.Artifacts` running on .NET RyuJIT (0 NativeAOT benchmark runs exist in this snapshot).