pub struct ElementValidationState {Show 39 fields
pub local_name: NameId,
pub namespace: Option<NameId>,
pub element_decl: Option<ElementKey>,
pub schema_type: Option<TypeKey>,
pub content_state: ContentValidatorState,
pub content_type: Option<ContentType>,
pub is_nil: bool,
pub is_default: bool,
pub member_type: Option<TypeKey>,
pub typed_value: Option<XmlValue>,
pub normalized_value: Option<String>,
pub validity: SchemaValidity,
pub error_codes: Vec<&'static str>,
pub any_child_not_full: bool,
pub any_child_not_none: bool,
pub any_attr_not_full: bool,
pub any_attr_not_none: bool,
pub strictly_assessed: bool,
pub notation: Option<NotationKey>,
pub ns_context: Option<NamespaceContextSnapshot>,
pub element_serial: u64,
pub process_contents: ContentProcessing,
pub base_uri: String,
pub base_uri_set_by_xml_base: bool,
pub schema_location_hint_start: usize,
pub no_namespace_schema_location_hint_start: usize,
pub seen_attributes: HashSet<(Option<NameId>, NameId)>,
pub seen_id_attr: bool,
pub text_content: String,
pub has_text: bool,
pub has_element_children: bool,
pub type_source: Option<TypeSource>,
pub cta_selected: bool,
pub owns_assertion_buffer: bool,
pub has_type_alternatives: bool,
pub collected_attributes: Vec<(Option<NameId>, NameId, String)>,
pub assertion_element_ref: Option<u32>,
pub incoming_inherited: HashMap<(Option<NameId>, NameId), InheritedAttributeValue>,
pub outgoing_inherited: HashMap<(Option<NameId>, NameId), InheritedAttributeValue>,
}Expand description
Per-element state pushed onto the validation stack
Each time validate_element is called, a new ElementValidationState is
created and pushed. It is popped on validate_end_element.
Fields§
§local_name: NameIdLocal name of the element
namespace: Option<NameId>Namespace URI of the element (None for no-namespace)
element_decl: Option<ElementKey>Resolved element declaration, if found
schema_type: Option<TypeKey>Resolved schema type (simple or complex)
content_state: ContentValidatorStateContent model state for this element’s type
content_type: Option<ContentType>Content type classification (Empty, TextOnly, ElementOnly, Mixed)
is_nil: boolWhether xsi:nil=“true” was specified
is_default: boolWhether the element value came from a default declaration
member_type: Option<TypeKey>For union types: the actual member type that matched the value
typed_value: Option<XmlValue>The parsed typed value from simple-type validation
normalized_value: Option<String>The whitespace-normalized value (PSVI [schema normalized value])
validity: SchemaValidityCurrent validity status
error_codes: Vec<&'static str>Accumulated constraint codes for PSVI [schema error code]
any_child_not_full: boolTrue if any child element has [validation attempted] != Full
any_child_not_none: boolTrue if any child element has [validation attempted] != None
any_attr_not_full: boolTrue if any attribute has [validation attempted] != Full
any_attr_not_none: boolTrue if any attribute has [validation attempted] != None
strictly_assessed: boolWhether this element was strictly assessed (§5.2 key-sva)
notation: Option<NotationKey>Notation declaration resolved from a NOTATION-typed attribute (§3.14.5)
ns_context: Option<NamespaceContextSnapshot>Namespace context snapshot for resolving NOTATION QNames during attribute validation
element_serial: u64Unique serial number for this element (monotonically increasing). Used for XSD 1.1 ID/IDREF binding: same ID on the same owner element is allowed (§3.17.5.2).
process_contents: ContentProcessingHow to process wildcard-matched content
base_uri: StringEffective base URI for this element (inherited from parent, possibly
overridden by xml:base). Used to resolve relative schema-location
hints in xsi:schemaLocation / xsi:noNamespaceSchemaLocation.
base_uri_set_by_xml_base: boolWhether xml:base has already been applied on this element.
Prevents a duplicate xml:base attribute from overwriting the valid one.
schema_location_hint_start: usizeStart index of this element’s xsi:schemaLocation hints in the runtime buffer.
no_namespace_schema_location_hint_start: usizeStart index of this element’s xsi:noNamespaceSchemaLocation hints in the runtime buffer.
seen_attributes: HashSet<(Option<NameId>, NameId)>Set of (namespace, local_name) pairs for attributes already seen
seen_id_attr: boolWhether an ID-typed attribute has already been seen on this element. Used to enforce the “at most one ID-type attribute per element” rule (XSD 1.0 §3.4.4 / §3.5.6 ct-props-correct.5) at runtime, after wildcard-matched globals contribute.
text_content: StringAccumulated text content for the element
has_text: boolWhether any text nodes have been seen
has_element_children: boolWhether any child element nodes have been seen
type_source: Option<TypeSource>How the schema_type was determined
cta_selected: boolWhether CTA selected a type (XSD 1.1)
owns_assertion_buffer: boolWhether this element owns an assertion buffer frame (XSD 1.1)
has_type_alternatives: boolWhether this element has type alternatives (XSD 1.1)
collected_attributes: Vec<(Option<NameId>, NameId, String)>Collected attributes for type alternative XPath evaluation (XSD 1.1)
assertion_element_ref: Option<u32>Node ref of this element in the assertion fragment document (XSD 1.1).
Saved during detect_assertions_on_element for CTA re-detection.
incoming_inherited: HashMap<(Option<NameId>, NameId), InheritedAttributeValue>Incoming inherited attributes: the PSVI [inherited attributes]
for this element (XSD 1.1 §3.3.5.6, structures.html line 5200).
Snapshot of potentially-inherited attribute values from ancestors,
frozen at element open. This is what get_inherited_attributes()
returns and what CTA XDM construction reads. Never mutated after
push_element().
outgoing_inherited: HashMap<(Option<NameId>, NameId), InheritedAttributeValue>Outgoing inherited attributes: the propagation map for this element’s descendants.
Starts as a clone of incoming_inherited, then updated when this
element has explicit or defaulted inheritable attributes (which
shadow ancestor values per the nearest-owner rule,
structures.html line 5205). Children clone this map as their
incoming_inherited.
Implementations§
Trait Implementations§
Source§impl Clone for ElementValidationState
impl Clone for ElementValidationState
Source§fn clone(&self) -> ElementValidationState
fn clone(&self) -> ElementValidationState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more