pub struct XmlDomNode<'a, 'input> { /* private fields */ }Expand description
Copyable handle into a backend-neutral document arena.
Implementations§
Source§impl<'a, 'input> Node<'a, 'input>
impl<'a, 'input> Node<'a, 'input>
Sourcepub fn is_element(&self) -> bool
pub fn is_element(&self) -> bool
Returns whether this is an element.
Sourcepub fn is_comment(&self) -> bool
pub fn is_comment(&self) -> bool
Returns whether this is a comment.
Sourcepub fn parent_element(self) -> Option<Self>
pub fn parent_element(self) -> Option<Self>
Returns the parent only when it is an element.
Sourcepub fn first_child(self) -> Option<Self>
pub fn first_child(self) -> Option<Self>
Returns the first direct child node.
Sourcepub fn first_element_child(self) -> Option<Self>
pub fn first_element_child(self) -> Option<Self>
Returns the first direct element child.
Sourcepub fn last_element_child(self) -> Option<Self>
pub fn last_element_child(self) -> Option<Self>
Returns the last direct element child.
Sourcepub fn descendants(self) -> Descendants<'a, 'input> ⓘ
pub fn descendants(self) -> Descendants<'a, 'input> ⓘ
Iterates this node and its descendants in document order.
Sourcepub fn prev_sibling(self) -> Option<Self>
pub fn prev_sibling(self) -> Option<Self>
Returns the preceding sibling.
Sourcepub fn next_sibling(self) -> Option<Self>
pub fn next_sibling(self) -> Option<Self>
Returns the following sibling.
Sourcepub fn next_sibling_element(self) -> Option<Self>
pub fn next_sibling_element(self) -> Option<Self>
Returns the next sibling that is an element.
Sourcepub fn tag_name(self) -> ExpandedName<'a>
pub fn tag_name(self) -> ExpandedName<'a>
Returns the expanded element name, or an empty name for non-elements.
Sourcepub fn has_tag_name<'n, N>(self, name: N) -> boolwhere
N: Into<ExpandedName<'n>>,
pub fn has_tag_name<'n, N>(self, name: N) -> boolwhere
N: Into<ExpandedName<'n>>,
Tests an element against a local-name selector or an exact expanded name.
A bare string matches any namespace, mirroring roxmltree. Tuple forms
match the namespace exactly, including (None, name) for an
unqualified element.
Sourcepub fn attributes(self) -> Attributes<'a> ⓘ
pub fn attributes(self) -> Attributes<'a> ⓘ
Iterates non-namespace attributes in source order.
Sourcepub fn attribute<'n, N>(self, name: N) -> Option<&'a str>where
N: Into<ExpandedName<'n>>,
pub fn attribute<'n, N>(self, name: N) -> Option<&'a str>where
N: Into<ExpandedName<'n>>,
Looks up an unqualified attribute by local name.
Sourcepub fn namespaces(self) -> Namespaces<'a> ⓘ
pub fn namespaces(self) -> Namespaces<'a> ⓘ
Iterates in-scope namespace bindings.
Sourcepub fn lookup_namespace_uri(self, prefix: Option<&str>) -> Option<&'a str>
pub fn lookup_namespace_uri(self, prefix: Option<&str>) -> Option<&'a str>
Resolves a namespace prefix in this element’s in-scope bindings.
Sourcepub fn lookup_prefix(self, uri: &str) -> Option<&'a str>
pub fn lookup_prefix(self, uri: &str) -> Option<&'a str>
Finds an in-scope prefix for a namespace URI.