Documentation
xmlschema — XSD 1.0 Validator
Rigorous W3C XML Schema validation engine built for enterprise compliance and high assurance pipelines.
Installation
Add xmlschema to your dependencies:
[dependencies]
xmlschema = "0.0.13"
Validation Example
Validate XML documents against standard XSD schemas:
use ;
let xsd = read_to_string?;
let schema = parse_schema?;
let xml = read_to_string?;
let doc = parse?;
let report = validate;
if report.is_valid else
Supported Types & Facets
- Simple types: string, integer, decimal, boolean, dateTime, date, anyURI, hexBinary, base64Binary
- Complex types: sequences, choices, all groups, attribute declarations
- Restriction facets: minInclusive, maxInclusive, minExclusive, maxExclusive, length, minLength, maxLength, pattern (regex engine), enumeration
- Value-space comparisons: enumerations compare in the datatype value space (e.g.
trueand1, numeric formatting, case-insensitivehexBinary) - Binary length validation: octet-based length validation for
xs:hexBinaryandxs:base64Binary - W3C Conformance: 95.2% pass rate over 35,942 decided tests (34,226 pass, 0 panics) across the 39,420-test W3C XSD test suite.