pub struct ValidationRuntime<'a, S: ValidationSink> {
pub sink: S,
/* private fields */
}Expand description
Mutable per-run validation state.
Created by super::validator::SchemaValidator::start_run().
Holds the validation stack, identity constraint tables, sink, and all
other per-run mutable state. The struct is explicitly !Send + !Sync.
Fields§
§sink: SSink for errors and warnings
Implementations§
Source§impl<'a, S: ValidationSink> ValidationRuntime<'a, S>
impl<'a, S: ValidationSink> ValidationRuntime<'a, S>
Sourcepub fn set_location(&mut self, location: SourceLocation)
pub fn set_location(&mut self, location: SourceLocation)
Set the current source location for error reporting
Sourcepub fn clear_location(&mut self)
pub fn clear_location(&mut self)
Clear the current source location
Sourcepub fn identity_constraint_tables(
&self,
) -> Option<&HashMap<IdentityConstraintKey, KeyTable>>
pub fn identity_constraint_tables( &self, ) -> Option<&HashMap<IdentityConstraintKey, KeyTable>>
Returns the final identity constraint tables after validation completes.
Only available after end_validation() succeeds. Contains key/unique/keyref
tables accumulated during the root element’s validation scope.
Sourcepub fn set_unparsed_entities(&mut self, entities: HashSet<String>)
pub fn set_unparsed_entities(&mut self, entities: HashSet<String>)
Set the declared unparsed entity names from the document’s DTD.
When set, ENTITY/ENTITIES values are validated against this set per §3.16.4 String Valid clause 3: “Every ENTITY value in V is a declared entity name.”
Sourcepub fn set_instance_base_uri(&mut self, base_uri: impl Into<String>)
pub fn set_instance_base_uri(&mut self, base_uri: impl Into<String>)
Set the base URI of the instance document being validated.
This base URI is attached to every schema-location hint collected during validation so that relative URIs can be resolved correctly when schemas are loaded later.
Sourcepub fn schema_location_hints(&self) -> &[SchemaLocationHint]
pub fn schema_location_hints(&self) -> &[SchemaLocationHint]
Returns accumulated xsi:schemaLocation hints.
Each hint contains a namespace/location pair plus the instance base
URI for resolving relative locations. Complete pairs from every
xsi:schemaLocation attribute are included, even from attributes
that failed even-token-count enforcement (the complete pairs are
still valid hints). Any trailing unpaired token is ignored.
Sourcepub fn no_namespace_schema_location_hints(
&self,
) -> &[NoNamespaceSchemaLocationHint]
pub fn no_namespace_schema_location_hints( &self, ) -> &[NoNamespaceSchemaLocationHint]
Returns accumulated xsi:noNamespaceSchemaLocation hints.
Sourcepub fn validate_element(
&mut self,
local_name: &str,
namespace_uri: &str,
xsi_type: Option<&str>,
xsi_nil: Option<&str>,
ns_context: &NamespaceContextSnapshot,
) -> SchemaInfo
pub fn validate_element( &mut self, local_name: &str, namespace_uri: &str, xsi_type: Option<&str>, xsi_nil: Option<&str>, ns_context: &NamespaceContextSnapshot, ) -> SchemaInfo
Validate an element start event (string-based lookup)
local_name and namespace_uri identify the element.
xsi_type is the value of xsi:type (if present), as a raw QName string.
xsi_nil is the value of xsi:nil (if present).
ns_context is used to resolve the xsi:type QName prefix.
Sourcepub fn validate_element_by_id(
&mut self,
local_name: NameId,
namespace: Option<NameId>,
xsi_type: Option<&str>,
xsi_nil: Option<&str>,
ns_context: &NamespaceContextSnapshot,
) -> SchemaInfo
pub fn validate_element_by_id( &mut self, local_name: NameId, namespace: Option<NameId>, xsi_type: Option<&str>, xsi_nil: Option<&str>, ns_context: &NamespaceContextSnapshot, ) -> SchemaInfo
Validate an element start event (NameId fast-path)
Sourcepub fn validate_attribute(
&mut self,
local_name: &str,
namespace_uri: &str,
value: &str,
) -> SchemaInfo
pub fn validate_attribute( &mut self, local_name: &str, namespace_uri: &str, value: &str, ) -> SchemaInfo
Validate an attribute (string-based lookup)
Sourcepub fn validate_attribute_by_id(
&mut self,
local_name: NameId,
namespace: Option<NameId>,
value: &str,
) -> SchemaInfo
pub fn validate_attribute_by_id( &mut self, local_name: NameId, namespace: Option<NameId>, value: &str, ) -> SchemaInfo
Validate an attribute (NameId fast-path)
Sourcepub fn validate_end_of_attributes(&mut self) -> SchemaInfo
pub fn validate_end_of_attributes(&mut self) -> SchemaInfo
Signal end of attributes; checks for missing required attributes
Sourcepub fn validate_text(&mut self, text: &str)
pub fn validate_text(&mut self, text: &str)
Validate a text content event
Sourcepub fn validate_whitespace(&mut self, text: &str)
pub fn validate_whitespace(&mut self, text: &str)
Validate a whitespace-only text event
Whitespace is always allowed in element-only content (it is insignificant).
Sourcepub fn validate_end_element(&mut self) -> SchemaInfo
pub fn validate_end_element(&mut self) -> SchemaInfo
Validate an element end event
Sourcepub fn end_validation(&mut self) -> Result<(), ValidationError>
pub fn end_validation(&mut self) -> Result<(), ValidationError>
Finalize validation
Checks that the validation stack is empty and performs IDREF validation.
Sourcepub fn get_expected_elements(&self) -> Vec<ExpectedElement>
pub fn get_expected_elements(&self) -> Vec<ExpectedElement>
Get elements expected at the current position in the content model
Sourcepub fn get_expected_attributes(&self) -> Vec<ExpectedAttribute>
pub fn get_expected_attributes(&self) -> Vec<ExpectedAttribute>
Get attributes expected/allowed for the current element
Sourcepub fn get_default_attributes(&self) -> Vec<DefaultAttribute>
pub fn get_default_attributes(&self) -> Vec<DefaultAttribute>
Get default attributes that should be added to the current element
Sourcepub fn get_inherited_attributes(&self) -> Vec<InheritedAttribute>
pub fn get_inherited_attributes(&self) -> Vec<InheritedAttribute>
Get the [inherited attributes] PSVI property for the current element
(XSD 1.1 §3.3.5.6, structures.html line 5200).
Returns the frozen incoming_inherited snapshot — ancestor-owned
potentially-inherited attributes with nearest-owner shadowing.
This is the spec’s [inherited attributes] property; it is NOT
filtered by the element’s own [attributes].
Returns empty for skipped elements.
Sourcepub fn content_processing(&self) -> ContentProcessing
pub fn content_processing(&self) -> ContentProcessing
Get the content processing mode for the current element
Sourcepub fn take_deferred_attribute_results(&mut self) -> Vec<SchemaInfo>
pub fn take_deferred_attribute_results(&mut self) -> Vec<SchemaInfo>
Drain deferred attribute validation results collected during CTA processing.
Returns the SchemaInfo results in the same order as the attributes were
originally encountered. The internal buffer is emptied.