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
impl XmlAttr
Sourcepub fn search_ns_by_href(
&mut self,
doc: Option<XmlDocPtr>,
href: &str,
) -> Option<XmlNsPtr>
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.
Sourcepub fn get_content(&self) -> Option<String>
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().
Sourcepub fn get_content_to(&self, buf: &mut String) -> i32
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.
Trait Implementations§
Source§impl NodeCommon for XmlAttr
impl NodeCommon for XmlAttr
fn document(&self) -> Option<XmlDocPtr>
fn set_document(&mut self, doc: Option<XmlDocPtr>)
fn element_type(&self) -> XmlElementType
fn name(&self) -> Option<Cow<'_, str>>
fn children(&self) -> Option<XmlGenericNodePtr>
fn set_children(&mut self, children: Option<XmlGenericNodePtr>)
fn last(&self) -> Option<XmlGenericNodePtr>
fn set_last(&mut self, last: Option<XmlGenericNodePtr>)
fn next(&self) -> Option<XmlGenericNodePtr>
fn set_next(&mut self, next: Option<XmlGenericNodePtr>)
fn prev(&self) -> Option<XmlGenericNodePtr>
fn set_prev(&mut self, prev: Option<XmlGenericNodePtr>)
fn parent(&self) -> Option<XmlGenericNodePtr>
fn set_parent(&mut self, parent: Option<XmlGenericNodePtr>)
Source§fn unlink(&mut self)
fn unlink(&mut self)
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
fn is_text_node(&self) -> bool
Source§fn get_base(&self, doc: Option<XmlDocPtr>) -> Option<String>
fn get_base(&self, doc: Option<XmlDocPtr>) -> Option<String>
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 moreSource§fn get_last_child(&self) -> Option<XmlGenericNodePtr>
fn get_last_child(&self) -> Option<XmlGenericNodePtr>
Source§unsafe fn add_content(&mut self, content: &str)
unsafe fn add_content(&mut self, content: &str)
Source§unsafe fn add_child(
&mut self,
cur: XmlGenericNodePtr,
) -> Option<XmlGenericNodePtr>
unsafe fn add_child( &mut self, cur: XmlGenericNodePtr, ) -> Option<XmlGenericNodePtr>
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