pub struct XmlNode { /* private fields */ }Expand description
An XML element node handle. Cloning is cheap (Arc).
Implementations§
Source§impl XmlNode
impl XmlNode
Sourcepub fn append_child(&self, name: &str) -> XmlNode
pub fn append_child(&self, name: &str) -> XmlNode
Append a child element with the given name, return the new child
Sourcepub fn prepend_child(&self, name: &str) -> XmlNode
pub fn prepend_child(&self, name: &str) -> XmlNode
Prepend a child element
Sourcepub fn append_child_value(&self, name: &str, value: &str) -> XmlNode
pub fn append_child_value(&self, name: &str, value: &str) -> XmlNode
Append a child element with name and text value
Sourcepub fn prepend_child_value(&self, name: &str, value: &str) -> XmlNode
pub fn prepend_child_value(&self, name: &str, value: &str) -> XmlNode
Prepend a child element with name and text value
Sourcepub fn set_child_value(&self, name: &str, value: &str) -> bool
pub fn set_child_value(&self, name: &str, value: &str) -> bool
Set the value of a named child (creating it if needed)
Sourcepub fn child_value(&self, name: &str) -> String
pub fn child_value(&self, name: &str) -> String
Get the text value of a named child
Sourcepub fn child_value_self(&self) -> String
pub fn child_value_self(&self) -> String
Get the text content (value of first text child or self value)
Sourcepub fn first_child(&self) -> XmlNode
pub fn first_child(&self) -> XmlNode
Get the first child
Sourcepub fn last_child(&self) -> XmlNode
pub fn last_child(&self) -> XmlNode
Get the last child
Sourcepub fn next_sibling(&self) -> XmlNode
pub fn next_sibling(&self) -> XmlNode
Get next sibling (requires parent)
Sourcepub fn next_sibling_named(&self, name: &str) -> XmlNode
pub fn next_sibling_named(&self, name: &str) -> XmlNode
Get next sibling with a given name
Sourcepub fn previous_sibling(&self) -> XmlNode
pub fn previous_sibling(&self) -> XmlNode
Get previous sibling
Sourcepub fn previous_sibling_named(&self, name: &str) -> XmlNode
pub fn previous_sibling_named(&self, name: &str) -> XmlNode
Get previous sibling with a given name
Sourcepub fn remove_child_named(&self, name: &str)
pub fn remove_child_named(&self, name: &str)
Remove a child by name
Sourcepub fn remove_child(&self, child: &XmlNode)
pub fn remove_child(&self, child: &XmlNode)
Remove a specific child node
Sourcepub fn deep_clone(&self) -> XmlNode
pub fn deep_clone(&self) -> XmlNode
Deep clone (copy) of this subtree
Sourcepub fn append_copy(&self, other: &XmlNode) -> XmlNode
pub fn append_copy(&self, other: &XmlNode) -> XmlNode
Append a copy of another subtree
Sourcepub fn prepend_copy(&self, other: &XmlNode) -> XmlNode
pub fn prepend_copy(&self, other: &XmlNode) -> XmlNode
Prepend a copy of another subtree
Trait Implementations§
Auto Trait Implementations§
impl Freeze for XmlNode
impl !RefUnwindSafe for XmlNode
impl Send for XmlNode
impl Sync for XmlNode
impl Unpin for XmlNode
impl UnsafeUnpin for XmlNode
impl !UnwindSafe for XmlNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more