pub enum ResultNode {
Element {
name: QName,
namespaces: Vec<(Option<String>, String)>,
attributes: Vec<(QName, String)>,
children: Vec<ResultNode>,
schema_type: Option<Box<(String, String)>>,
attr_types: Vec<(QName, Box<(String, String)>)>,
},
Text {
content: String,
dose: bool,
},
Comment(String),
ProcessingInstruction {
target: String,
data: String,
},
Attribute {
name: QName,
value: String,
},
}Expand description
One node in an in-progress result tree. Element children
recurse via the children vec; attributes hang off the
element separately because XPath / serialisation treat them
differently from content children.
Variants§
Element
Fields
namespaces: Vec<(Option<String>, String)>(prefix, URI) namespace declarations to emit on this element. May be empty — by default we inherit from the parent and only emit declarations that introduce changes.
children: Vec<ResultNode>schema_type: Option<Box<(String, String)>>Schema-aware: the expanded name (ns, local) of the type
this element was constructed as — from a type= / xsl:type=
attribute or a validation= mode. None for the ordinary
untyped case. Carried through RTF indexing so a constructed
node’s typed value is recoverable by data() /
instance of (XSLT 2.0 §5.7.1, annotation-for-constructed-
element).
attr_types: Vec<(QName, Box<(String, String)>)>Schema-aware: governing type (ns, local) for any of this
element’s attributes constructed with a type= annotation,
keyed by attribute name. Sparse — empty for the ordinary
untyped case. Recorded into the RTF PSVI table alongside the
attribute node so data(@a) / @a instance of … see the
declared type.
Text
Fields
Comment(String)
ProcessingInstruction
Attribute
A parentless attribute node — the value of an xsl:attribute
evaluated with no element under construction (XSLT 2.0 §5.7.1
sequence constructors, e.g. an as="attribute()*" variable).
xsl:copy-of / xsl:apply-templates consume it; it never
appears among an element’s children (element attributes live in
the attributes vec).
Trait Implementations§
Source§impl Clone for ResultNode
impl Clone for ResultNode
Source§fn clone(&self) -> ResultNode
fn clone(&self) -> ResultNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more