Class XsdValidator
Validates XML message bodies against an XSD (XML Schema Definition).
Uses the built-in and validation —
no external NuGet packages required.
The validator accepts body as , ,
(raw XML), or a POCO (auto-serialized via ).
public sealed class XsdValidator : IMessageValidator
Inheritance
Implements
Methods
FromFile(string, string?, string?)
Creates a validator from an XSD file, with its xs:import and xs:include read relative to the
public static XsdValidator FromFile(string path, string? targetNamespace = null, string? schemaRoot = null)
Validate(IExchange)
Validates the exchange and returns a result indicating success or failure with error details.
public ValidationResult Validate(IExchange exchange)
Constructors
XsdValidator(string?, string)
Creates a validator from an XSD string with an explicit target namespace.
XsdValidator(string)
Creates a validator from an XSD string (target namespace auto-detected).
XsdValidator(XmlSchemaSet)
Creates a validator from a pre-built .