Skip to main content

ResultNode

Enum ResultNode 

Source
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

§name: QName
§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.

§attributes: Vec<(QName, String)>
§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

§content: String
§dose: bool

disable-output-escaping — when true, the serialiser emits the content verbatim (no &amp; / &lt;). Used by <xsl:text disable-output-escaping="yes"/> and <xsl:value-of disable-output-escaping="yes"/>.

§

Comment(String)

§

ProcessingInstruction

Fields

§target: String
§data: String
§

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).

Fields

§name: QName
§value: String

Trait Implementations§

Source§

impl Clone for ResultNode

Source§

fn clone(&self) -> ResultNode

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 ResultNode

Source§

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

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> 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> Same for T

Source§

type Output = T

Should always be Self
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.