pub enum SchemaVersion {
Xsd10,
Xsd11,
Auto,
}Expand description
Which XSD version the compiler should target. XSD 1.1 is a strict
superset of 1.0 — every 1.0 schema is also a valid 1.1 schema — so
the choice only matters when a schema uses a 1.1-specific
construct (xs:assert, xs:alternative, xs:override, wildcard
notQName / notNamespace, the 1.1-added built-in datatypes, …).
Defaults to Xsd10 — matches libxml2’s
behaviour, matches Xerces and Saxon’s defaults, and avoids the
“schema looked like it compiled but the 1.1 constraints aren’t
actually being enforced” failure mode that auto-detection produces
when authors forget to set vc:minVersion.
Variants§
Xsd10
Strict XSD 1.0 — reject any 1.1 construct. Equivalent to libxml2’s behaviour. Recommended for any pipeline that’s migrating from libxml2 or whose schemas predate 2012.
Xsd11
Strict XSD 1.1 — accept 1.1 constructs unconditionally,
without requiring vc:minVersion on the schema document.
Auto
Hybrid: start in 1.0 mode, auto-promote to 1.1 when the schema
document carries vc:minVersion="1.1" on its root element.
Convenient for mixed corpora; explicit opt-in via
Xsd11 is still preferred for
production pipelines because most 1.1 schemas in the wild
don’t bother to set vc:minVersion.
Trait Implementations§
Source§impl Clone for SchemaVersion
impl Clone for SchemaVersion
Source§fn clone(&self) -> SchemaVersion
fn clone(&self) -> SchemaVersion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SchemaVersion
Source§impl Debug for SchemaVersion
impl Debug for SchemaVersion
Source§impl Default for SchemaVersion
impl Default for SchemaVersion
Source§fn default() -> SchemaVersion
fn default() -> SchemaVersion
impl Eq for SchemaVersion
Source§impl PartialEq for SchemaVersion
impl PartialEq for SchemaVersion
Source§fn eq(&self, other: &SchemaVersion) -> bool
fn eq(&self, other: &SchemaVersion) -> bool
self and other values to be equal, and is used by ==.