XmlAttr

Struct XmlAttr 

Source
pub struct XmlAttr {
    pub _private: *mut c_void,
    pub name: Box<str>,
    pub next: Option<XmlAttrPtr>,
    pub ns: Option<XmlNsPtr>,
    /* private fields */
}

Fields§

§_private: *mut c_void§name: Box<str>§next: Option<XmlAttrPtr>§ns: Option<XmlNsPtr>

Implementations§

Source§

impl XmlAttr

Source

pub fn search_ns_by_href( &mut self, doc: Option<XmlDocPtr>, href: &str, ) -> Option<XmlNsPtr>

Search a Ns aliasing a given URI. Recurse on the parents until it finds the defined namespace or return NULL otherwise.

Returns the namespace pointer or NULL.

Source

pub fn get_content(&self) -> Option<String>

Read the value of a node, this can be either the text carried directly by this node if it’s a TEXT node or the aggregate string of the values carried by this node child’s (TEXT and ENTITY_REF).

Entity references are substituted.

Returns a new #XmlChar * or null_mut() if no content is available.
It’s up to the caller to free the memory with xml_free().

Source

pub fn get_content_to(&self, buf: &mut String) -> i32

Read the value of a node cur, this can be either the text carried directly by this node if it’s a TEXT node or the aggregate string of the values carried by this node child’s (TEXT and ENTITY_REF).

Entity references are substituted. Fills up the buffer buf with this value.

Returns 0 in case of success and -1 in case of error.

Source

pub fn set_base(&mut self, _uri: Option<&str>)

Set (or reset) the base URI of a node, i.e. the value of the xml:base attribute.

Source

pub fn set_doc(&mut self, doc: Option<XmlDocPtr>)

update all nodes under the tree to point to the right document

Trait Implementations§

Source§

impl Default for XmlAttr

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl NodeCommon for XmlAttr

Source§

fn document(&self) -> Option<XmlDocPtr>

Source§

fn set_document(&mut self, doc: Option<XmlDocPtr>)

Source§

fn element_type(&self) -> XmlElementType

Source§

fn name(&self) -> Option<Cow<'_, str>>

Source§

fn children(&self) -> Option<XmlGenericNodePtr>

Source§

fn set_children(&mut self, children: Option<XmlGenericNodePtr>)

Source§

fn last(&self) -> Option<XmlGenericNodePtr>

Source§

fn set_last(&mut self, last: Option<XmlGenericNodePtr>)

Source§

fn next(&self) -> Option<XmlGenericNodePtr>

Source§

fn set_next(&mut self, next: Option<XmlGenericNodePtr>)

Source§

fn prev(&self) -> Option<XmlGenericNodePtr>

Source§

fn set_prev(&mut self, prev: Option<XmlGenericNodePtr>)

Source§

fn parent(&self) -> Option<XmlGenericNodePtr>

Source§

fn set_parent(&mut self, parent: Option<XmlGenericNodePtr>)

Unlink a node from it’s current context, the node is not freed.
If one need to free the node, use xmlFreeNode() routine after the unlink to discard it. Read more
Source§

fn is_text_node(&self) -> bool

Check whether this node is a Text node or not.
Source§

fn get_base(&self, doc: Option<XmlDocPtr>) -> Option<String>

Searches for the BASE URL. The code should work on both XML and HTML document even if base mechanisms are completely different.
It returns the base as defined in RFC 2396 sections 5.1.1. Base URI within Document Content and 5.1.2. Base URI from the Encapsulating Entity.
However it does not return the document base (5.1.3), use doc.url in this case Read more
Source§

fn get_last_child(&self) -> Option<XmlGenericNodePtr>

Search the last child of a node. Returns the last child or null_mut() if none.
Source§

unsafe fn add_content(&mut self, content: &str)

Append the extra substring to the node content. Read more
Source§

unsafe fn add_child( &mut self, cur: XmlGenericNodePtr, ) -> Option<XmlGenericNodePtr>

Add a new node to self, at the end of the child (or property) list merging adjacent TEXT nodes (in which case cur is freed)
If the new node is ATTRIBUTE, it is added into properties instead of children.
If there is an attribute with equal name, it is first destroyed. Read more
Source§

fn first_element_child(&self) -> Option<XmlNodePtr>

Finds the first child node of that element which is a Element node. Read more
Source§

fn last_element_child(&self) -> Option<XmlNodePtr>

Finds the last child node of that element which is a Element node. Read more
Source§

fn child_element_count(&self) -> u64

Finds the current number of child nodes of that element which are element nodes. Read more
Source§

fn next_element_sibling(&self) -> Option<XmlNodePtr>

Finds the first closest next sibling of the node which is an element node. Read more
Source§

fn previous_element_sibling(&self) -> Option<XmlNodePtr>

Finds the first closest previous sibling of the node which is an element node. Read more

Auto Trait Implementations§

§

impl Freeze for XmlAttr

§

impl !RefUnwindSafe for XmlAttr

§

impl !Send for XmlAttr

§

impl !Sync for XmlAttr

§

impl Unpin for XmlAttr

§

impl !UnwindSafe for XmlAttr

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> 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, 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V