Skip to content

Search EricksonLopez.* Ecosystem

Type a library name, NuGet package ID, .NET type, or architectural concept to search across the portal.

Core Concepts — Schema Cache, Anti-XXE & Root Element Validation

EricksonLopez.Xml.Validation ensures thread-safe schema reuse and strict XML parser hardening across every validation entry point.

  • Concurrent lookup: Backed by ConcurrentDictionary<string, SchemaCacheEntry> supporting RegisterSchema (string, Stream, ReadOnlySpan<byte>), ContainsSchema, Count, and Clear.
  • Root element index: Pre-indexes global XSD element declarations so ValidateRootElement detects undeclared roots before streaming the full body.
  • Boundary isolation (ADR-017): XmlSchemaValidator retrieves compiled schema sets through internal IXmlSchemaSetProvider so callers cannot mutate cached XmlSchemaSet graphs concurrently.
  • Prohibited DTDs & external resolvers: Every XmlReaderSettings disables DtdProcessing.Prohibit and assigns XmlResolver = null.
  • Supported inputs: Validate(string, targetNamespace), Validate(ReadOnlySpan<byte>, targetNamespace), Validate(Stream, targetNamespace) (leaveOpen: true), and ValidateAsync(Stream, targetNamespace, CancellationToken).