pub struct XsdComponent {Show 19 fields
pub component_type: XsdComponentType,
pub name: Option<String>,
pub target_namespace: Option<String>,
pub children: Vec<XsdComponent>,
pub attributes: Vec<XsdComponent>,
pub datatype: Option<XsdDatatypeKind>,
pub facets: Vec<(XsdDatatypeKind, String)>,
pub base: Option<String>,
pub min_occurs: i32,
pub max_occurs: i32,
pub ref_name: Option<String>,
pub substitution_group: Option<String>,
pub is_abstract: bool,
pub is_final: bool,
pub block: Vec<String>,
pub mixed: bool,
pub form: Option<String>,
pub default_value: Option<String>,
pub fixed_value: Option<String>,
}Expand description
An XSD schema component declaration.
Represents any XSD component (element, attribute, type, model group, etc.).
Components form a tree via the children and attributes vectors.
Fields§
§component_type: XsdComponentTypeThe kind of XSD component this declaration represents.
name: Option<String>The component’s local name (from the name attribute); None for
anonymous components.
target_namespace: Option<String>The namespace the component is declared in.
children: Vec<XsdComponent>Child components — model group children, inline type definitions, etc.
attributes: Vec<XsdComponent>Attribute declarations belonging to this component (complex types).
datatype: Option<XsdDatatypeKind>The resolved built-in datatype kind, when the component is typed with a built-in XSD type.
facets: Vec<(XsdDatatypeKind, String)>Facets constraining the type, stored as (facet kind, facet value) pairs.
base: Option<String>The base type of a derived type (restriction/extension/list/union), or
the unresolved type name for elements/attributes with a named type.
min_occurs: i32Minimum occurrence count (default 1; 0 for optional). Also reused for
the use attribute of attribute declarations.
max_occurs: i32Maximum occurrence count; -1 for unbounded.
ref_name: Option<String>For references: the name of the referenced element/attribute (from the
ref attribute).
substitution_group: Option<String>The name of the substitution group this element belongs to.
is_abstract: boolWhether the component is declared abstract (cannot be used directly).
is_final: boolWhether the component is declared final (cannot be derived from).
block: Vec<String>The block attribute: derivation methods disallowed for the type.
mixed: boolWhether the type allows mixed element content (xs:complexType mixed).
form: Option<String>The form attribute (qualified/unqualified) for this component,
overriding the schema’s elementFormDefault/attributeFormDefault.
default_value: Option<String>The default value of an element/attribute declaration. Elements with
a simple type default their text content; attributes that are absent
from an instance get this value injected under
XML_SCHEMA_VAL_VC_I_CREATE (LIBXML_SCHEMA_CREATE).
fixed_value: Option<String>The fixed value of an element/attribute declaration (absent
attributes are created with it; present values must equal it).
Implementations§
Source§impl XsdComponent
impl XsdComponent
Sourcepub const fn new(component_type: XsdComponentType) -> Self
pub const fn new(component_type: XsdComponentType) -> Self
Create a new component with the given type and default field values.
Defaults: min_occurs = 1, max_occurs = 1, all optional fields None.
Trait Implementations§
Source§impl Clone for XsdComponent
impl Clone for XsdComponent
Source§fn clone(&self) -> XsdComponent
fn clone(&self) -> XsdComponent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more