Skip to main content

Module schema

Module schema 

Source
Expand description

Compiled-schema data structures.

A Schema is the output of the schema compiler — a graph of reference-counted declarations and type definitions, ready for the validator to consume.

Names are QNames carrying the namespace URI alongside the local name; the schema compiler resolves prefixes to URIs at compile time so the runtime never has to deal with prefix bookkeeping.

Structs§

Assertion
XSD 1.1 <xs:assert test="…"> / <xs:assertion test="…">.
AttributeDecl
<xs:attribute> — top-level or local.
AttributeGroup
<xs:attributeGroup> — a named bundle of attribute uses, referenced from complex types via <xs:attributeGroup ref="…"/>.
AttributeUse
How an attribute appears within a complex type.
BlockSet
ElementDecl
<xs:element> declaration — top-level or local.
ModelGroup
<xs:group> — a named model-group particle, referenced from complex types or other groups.
NotationDecl
Particle
One particle in a content model — an element, a wildcard, or a nested group — with occurrence bounds.
QName
A namespace-qualified XML name. XSD operates entirely in terms of these — local names alone are insufficient when a schema imports other namespaces.
Schema
The top-level compiled schema. Cheap to clone (one Arc bump).
SchemaOptions
Knobs for Schema::compile_str_with_options / Schema::compile_with_options.
Wildcard
<xs:any> / <xs:anyAttribute> wildcard configuration.

Enums§

AttributeUseKind
ContentModel
A type’s body shape: nothing, a simple value, or a particle tree.
GroupKind
MaxOccurs
NamespaceConstraint
ProcessContents
SchemaVersion
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, …).
Term
TypeRef
A type reference — either a simple or complex type. Used everywhere an element’s type=... is resolved.