Description
Add support for XML Schema Definition (XSD) based document validation to the AngleSharp.Xml library. This feature would allow consumers to validate XML documents against one or more XSD schemas during or after parsing and obtain detailed validation diagnostics, including errors and warnings.
The API should support:
- Validating an existing XML document against one or more XSD schemas.
- Collecting validation errors and warnings with location information where available.
- Resolving schema imports and includes.
- Supporting namespace-aware validation.
- Configurable validation behavior (e.g., fail-fast vs. collect all validation errors).
This functionality should integrate naturally with the existing AngleSharp.Xml parsing model while remaining optional for users who do not require schema validation.
Background
Many XML-based formats define their structure through XML Schema (XSD). While AngleSharp.Xml provides XML parsing capabilities, users currently need to rely on external APIs or libraries to perform schema validation.
Common scenarios include:
- Validating configuration files before processing.
- Ensuring generated XML documents conform to an expected schema.
- Verifying third-party XML payloads before deserialization.
- Building XML tooling where parsing and validation are expected to be part of the same workflow.
Providing built-in XSD validation would simplify these workflows and make AngleSharp.Xml a more complete solution for XML processing.
Specification
The feature should implement XML Schema validation as defined by the W3C XML Schema specifications:
- XML Schema Part 1: Structures
- XML Schema Part 2: Datatypes
The implementation should support XML Schema 1.0 as the initial target. Support for XML Schema 1.1 may be considered separately if it introduces significant additional complexity.
Description
Add support for XML Schema Definition (XSD) based document validation to the
AngleSharp.Xmllibrary. This feature would allow consumers to validate XML documents against one or more XSD schemas during or after parsing and obtain detailed validation diagnostics, including errors and warnings.The API should support:
This functionality should integrate naturally with the existing
AngleSharp.Xmlparsing model while remaining optional for users who do not require schema validation.Background
Many XML-based formats define their structure through XML Schema (XSD). While
AngleSharp.Xmlprovides XML parsing capabilities, users currently need to rely on external APIs or libraries to perform schema validation.Common scenarios include:
Providing built-in XSD validation would simplify these workflows and make
AngleSharp.Xmla more complete solution for XML processing.Specification
The feature should implement XML Schema validation as defined by the W3C XML Schema specifications:
The implementation should support XML Schema 1.0 as the initial target. Support for XML Schema 1.1 may be considered separately if it introduces significant additional complexity.