Skip to main content

sup_xml_core/xsd/
mod.rs

1//! XML Schema 1.0 — schema compiler and instance validator.
2//!
3//! This module is feature-gated behind `xsd`.  The public surface is small:
4//!
5//! ```ignore
6//! use sup_xml_core::xsd::Schema;
7//!
8//! let schema  = Schema::compile_str(xsd_text)?;
9//! schema.validate_str(instance_xml)?;
10//! ```
11//!
12//! See `thoughts/xsd_plan.txt` in the repo for the full architecture and
13//! scope.
14
15#![forbid(unsafe_code)]  // see CONTRIBUTING.md § "Unsafe policy"
16
17pub mod datetime;
18pub mod dfa;
19mod error;
20mod facets;
21pub mod identity;
22mod lexical;
23mod parser;
24mod particle_restriction;
25/// Re-exported for backwards compatibility — the regex engine
26/// itself lives at [`crate::regex`] and is feature-independent.
27pub use crate::regex;
28mod resolver;
29pub mod schema;
30pub mod types;
31mod assertion;
32mod validate;
33mod whitespace;
34
35pub use error::{
36    SchemaCompileError, ValidationError, ValidationIssue, ValidationKind, ValidationOptions,
37};
38pub use facets::{Facet, FacetSet, FacetViolation, TimezoneRequirement};
39pub use identity::{ConstraintKind, IdentityConstraint, FieldPath, NameTest, PathExpr,
40    PathStep, SelectorPath};
41pub use resolver::{FsResolver, InMemoryResolver, NoResolver, SchemaResolver};
42pub use schema::{
43    AttributeDecl, AttributeGroup, AttributeUse, AttributeUseKind, BlockSet, ContentModel,
44    ElementDecl, GroupKind, MaxOccurs, ModelGroup, NamespaceConstraint, NotationDecl, Particle,
45    ProcessContents, QName, Schema, SchemaOptions, SchemaVersion, Term, TypeRef, Wildcard,
46};
47pub use types::{
48    BuiltinType, ComplexType, Derivation, DerivationMethod, SimpleType, TypeDef, Value,
49};
50pub use validate::PsviTypes;
51pub use whitespace::WhitespaceMode;