Skip to main content

ElementValidationState

Struct ElementValidationState 

Source
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: NameId

Local 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: ContentValidatorState

Content model state for this element’s type

§content_type: Option<ContentType>

Content type classification (Empty, TextOnly, ElementOnly, Mixed)

§is_nil: bool

Whether xsi:nil=“true” was specified

§is_default: bool

Whether 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: SchemaValidity

Current validity status

§error_codes: Vec<&'static str>

Accumulated constraint codes for PSVI [schema error code]

§any_child_not_full: bool

True if any child element has [validation attempted] != Full

§any_child_not_none: bool

True if any child element has [validation attempted] != None

§any_attr_not_full: bool

True if any attribute has [validation attempted] != Full

§any_attr_not_none: bool

True if any attribute has [validation attempted] != None

§strictly_assessed: bool

Whether 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: u64

Unique 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: ContentProcessing

How to process wildcard-matched content

§base_uri: String

Effective 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: bool

Whether xml:base has already been applied on this element. Prevents a duplicate xml:base attribute from overwriting the valid one.

§schema_location_hint_start: usize

Start index of this element’s xsi:schemaLocation hints in the runtime buffer.

§no_namespace_schema_location_hint_start: usize

Start 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: bool

Whether 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: String

Accumulated text content for the element

§has_text: bool

Whether any text nodes have been seen

§has_element_children: bool

Whether any child element nodes have been seen

§type_source: Option<TypeSource>

How the schema_type was determined

§cta_selected: bool

Whether CTA selected a type (XSD 1.1)

§owns_assertion_buffer: bool

Whether this element owns an assertion buffer frame (XSD 1.1)

§has_type_alternatives: bool

Whether 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§

Source§

impl ElementValidationState

Source

pub fn new(local_name: NameId, namespace: Option<NameId>) -> Self

Create a new element validation state with defaults

Trait Implementations§

Source§

impl Clone for ElementValidationState

Source§

fn clone(&self) -> ElementValidationState

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ElementValidationState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeSendSync for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.