oxml
🌐 EN , Change language

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.10"

Validation Example

Validate XML files against standard XSD schemas:

use xmlschema::Schema;

let xsd = std::fs::read_to_string("schema.xsd")?;
let schema = Schema::parse(&xsd)?;

let xml = std::fs::read_to_string("document.xml")?;
match schema.validate(&xml) {
    Ok(()) => println!("Document is strictly valid!"),
    Err(e) => eprintln!("Validation error: {}", e),
}

Supported Types

  • Simple types: string, integer, decimal, boolean, dateTime, date, anyURI
  • Complex types: sequences, choices, all groups
  • Facets: minInclusive, maxInclusive, length, minLength, maxLength, pattern (regex), enumeration