pub enum Node<'d> {
Root(Root<'d>),
Element(Element<'d>),
Attribute(Attribute<'d>),
Text(Text<'d>),
Comment(Comment<'d>),
Namespace(Namespace<'d>),
ProcessingInstruction(ProcessingInstruction<'d>),
}
Expand description
Any of the various types of nodes found in an XML document.
Variants§
Root(Root<'d>)
Element(Element<'d>)
Attribute(Attribute<'d>)
Text(Text<'d>)
Comment(Comment<'d>)
Namespace(Namespace<'d>)
ProcessingInstruction(ProcessingInstruction<'d>)
Implementations§
source§impl<'d> Node<'d>
impl<'d> Node<'d>
sourcepub fn prefixed_name(&self) -> Option<String>
pub fn prefixed_name(&self) -> Option<String>
The name of the node, including a prefix that corresponds to the namespace, if any.
sourcepub fn expanded_name(&self) -> Option<QName<'d>>
pub fn expanded_name(&self) -> Option<QName<'d>>
Returns the expanded name of the node, if any.
sourcepub fn preceding_siblings(&self) -> Vec<Node<'d>>
pub fn preceding_siblings(&self) -> Vec<Node<'d>>
Returns the nodes with the same parent that occur before this node.
sourcepub fn following_siblings(&self) -> Vec<Node<'d>>
pub fn following_siblings(&self) -> Vec<Node<'d>>
Returns the nodes with the same parent that occur after this node.
sourcepub fn string_value(&self) -> String
pub fn string_value(&self) -> String
Returns the string value of this node.
pub fn root(self) -> Option<Root<'d>>
pub fn element(self) -> Option<Element<'d>>
pub fn attribute(self) -> Option<Attribute<'d>>
pub fn text(self) -> Option<Text<'d>>
pub fn comment(self) -> Option<Comment<'d>>
pub fn processing_instruction(self) -> Option<ProcessingInstruction<'d>>
pub fn namespace(self) -> Option<Namespace<'d>>
Trait Implementations§
source§impl<'d> Extend<Node<'d>> for Nodeset<'d>
impl<'d> Extend<Node<'d>> for Nodeset<'d>
source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = Node<'d>>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = Node<'d>>,
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl<'d> From<ProcessingInstruction<'d>> for Node<'d>
impl<'d> From<ProcessingInstruction<'d>> for Node<'d>
source§fn from(v: ProcessingInstruction<'d>) -> Node<'d>
fn from(v: ProcessingInstruction<'d>) -> Node<'d>
Converts to this type from the input type.
source§impl<'d> FromIterator<Node<'d>> for Nodeset<'d>
impl<'d> FromIterator<Node<'d>> for Nodeset<'d>
source§impl<'d> FromIterator<Node<'d>> for OrderedNodes<'d>
impl<'d> FromIterator<Node<'d>> for OrderedNodes<'d>
source§fn from_iter<I>(iterator: I) -> OrderedNodes<'d>where
I: IntoIterator<Item = Node<'d>>,
fn from_iter<I>(iterator: I) -> OrderedNodes<'d>where
I: IntoIterator<Item = Node<'d>>,
Creates a value from an iterator. Read more