pub struct SchemaInfo {Show 17 fields
pub element_decl: Option<ElementKey>,
pub attribute_decl: Option<AttributeKey>,
pub schema_type: Option<TypeKey>,
pub member_type: Option<TypeKey>,
pub validity: SchemaValidity,
pub validation_attempted: ValidationAttempted,
pub is_default: bool,
pub is_nil: bool,
pub content_type: Option<ContentType>,
pub typed_value: Option<XmlValue>,
pub normalized_value: Option<String>,
pub schema_error_codes: Vec<&'static str>,
pub notation: Option<NotationKey>,
pub deferred_by_cta: bool,
pub type_source: Option<TypeSource>,
pub cta_selected: bool,
pub assertion_outcome: Option<AssertionOutcome>,
}Expand description
Schema information returned after validating a node
Contains the resolved schema components and validation status for an element or attribute.
Fields§
§element_decl: Option<ElementKey>The element declaration, if one was found
attribute_decl: Option<AttributeKey>The attribute declaration, if one was found
schema_type: Option<TypeKey>The resolved schema type (simple or complex)
member_type: Option<TypeKey>For union types: the actual member type that matched the value
validity: SchemaValidityValidity status
validation_attempted: ValidationAttemptedHow much validation was attempted (PSVI [validation attempted])
is_default: boolWhether the value was supplied by a default declaration
is_nil: boolWhether the element was declared nil via xsi:nil=“true”
content_type: Option<ContentType>Content type of the element (Empty, TextOnly, ElementOnly, Mixed)
typed_value: Option<XmlValue>The parsed typed value from simple-type validation
normalized_value: Option<String>The whitespace-normalized value (PSVI [schema normalized value])
schema_error_codes: Vec<&'static str>Constraint codes from validation errors on this node (PSVI [schema error code])
notation: Option<NotationKey>Notation declaration resolved from a NOTATION-typed attribute (PSVI [notation]).
Only meaningful on element-end SchemaInfo; always None for attributes.
deferred_by_cta: boolWhether this attribute was deferred due to CTA (type alternatives)
type_source: Option<TypeSource>How the schema_type was determined (declaration, xsi:type, or CTA)
cta_selected: boolWhether CTA evaluation selected a type (even if it matches the declared type)
assertion_outcome: Option<AssertionOutcome>Complex-type assertion outcome (XSD 1.1, end-element SchemaInfo only)
Implementations§
Source§impl SchemaInfo
impl SchemaInfo
Sourcepub fn valid_element(
element_decl: ElementKey,
schema_type: TypeKey,
content_type: ContentType,
) -> Self
pub fn valid_element( element_decl: ElementKey, schema_type: TypeKey, content_type: ContentType, ) -> Self
Create a SchemaInfo indicating a valid element
Sourcepub fn valid_attribute(
attribute_decl: AttributeKey,
schema_type: TypeKey,
) -> Self
pub fn valid_attribute( attribute_decl: AttributeKey, schema_type: TypeKey, ) -> Self
Create a SchemaInfo indicating a valid attribute
Sourcepub fn is_simple_type(&self) -> bool
pub fn is_simple_type(&self) -> bool
Returns true if the resolved schema type is a simple type.
Sourcepub fn is_complex_type(&self) -> bool
pub fn is_complex_type(&self) -> bool
Returns true if the resolved schema type is a complex type.
Trait Implementations§
Source§impl Clone for SchemaInfo
impl Clone for SchemaInfo
Source§fn clone(&self) -> SchemaInfo
fn clone(&self) -> SchemaInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more