pub struct XmlDoc {
pub version: String,
pub encoding: Option<String>,
pub standalone: Option<bool>,
pub dtd: Option<XmlDtd>,
/* private fields */
}Expand description
libxml2 xmlDoc.
Fields§
§version: StringXML version string; default "1.0".
encoding: Option<String>Encoding name from the XML declaration, if any.
standalone: Option<bool>Some(true/false) from standalone, None if omitted.
dtd: Option<XmlDtd>Internal / attached DTD, if any.
Implementations§
Source§impl XmlDoc
impl XmlDoc
Sourcepub fn xml_new_doc(version: Option<&str>) -> Self
pub fn xml_new_doc(version: Option<&str>) -> Self
xmlNewDoc.
pub fn node(&self, id: NodeId) -> &Node
pub fn node_mut(&mut self, id: NodeId) -> &mut Node
pub fn kind(&self, id: NodeId) -> NodeKind
pub fn name(&self, id: NodeId) -> &str
pub fn prefix(&self, id: NodeId) -> Option<&str>
pub fn ns_uri(&self, id: NodeId) -> Option<&str>
pub fn content(&self, id: NodeId) -> &str
pub fn parent(&self, id: NodeId) -> Option<NodeId>
pub fn first_child(&self, id: NodeId) -> Option<NodeId>
pub fn last_child(&self, id: NodeId) -> Option<NodeId>
pub fn next_sibling(&self, id: NodeId) -> Option<NodeId>
pub fn prev_sibling(&self, id: NodeId) -> Option<NodeId>
pub fn first_attr(&self, id: NodeId) -> Option<NodeId>
pub fn ns_defs(&self, id: NodeId) -> &[(Option<String>, String)]
pub fn alloc(&mut self, kind: NodeKind, name: impl Into<String>) -> NodeId
Sourcepub fn xml_doc_get_root_element(&self) -> Option<NodeId>
pub fn xml_doc_get_root_element(&self) -> Option<NodeId>
xmlDocGetRootElement.
Sourcepub fn xml_doc_set_root_element(&mut self, elem: NodeId) -> Option<NodeId>
pub fn xml_doc_set_root_element(&mut self, elem: NodeId) -> Option<NodeId>
xmlDocSetRootElement. Returns the previous root, if any.
Sourcepub fn xml_new_doc_node(
&mut self,
ns_uri: Option<&str>,
name: &str,
content: Option<&str>,
) -> NodeId
pub fn xml_new_doc_node( &mut self, ns_uri: Option<&str>, name: &str, content: Option<&str>, ) -> NodeId
xmlNewDocNode.
Sourcepub fn xml_new_child(
&mut self,
parent: NodeId,
ns_uri: Option<&str>,
name: &str,
content: Option<&str>,
) -> NodeId
pub fn xml_new_child( &mut self, parent: NodeId, ns_uri: Option<&str>, name: &str, content: Option<&str>, ) -> NodeId
xmlNewChild.
Sourcepub fn xml_add_child(&mut self, parent: NodeId, child: NodeId)
pub fn xml_add_child(&mut self, parent: NodeId, child: NodeId)
xmlAddChild.
Sourcepub fn xml_add_next_sibling(&mut self, cur: NodeId, elem: NodeId)
pub fn xml_add_next_sibling(&mut self, cur: NodeId, elem: NodeId)
xmlAddNextSibling.
Sourcepub fn xml_add_prev_sibling(&mut self, cur: NodeId, elem: NodeId)
pub fn xml_add_prev_sibling(&mut self, cur: NodeId, elem: NodeId)
xmlAddPrevSibling.
Sourcepub fn xml_unlink_node(&mut self, id: NodeId)
pub fn xml_unlink_node(&mut self, id: NodeId)
xmlUnlinkNode.
Sourcepub fn xml_replace_node(&mut self, old: NodeId, new: NodeId) -> NodeId
pub fn xml_replace_node(&mut self, old: NodeId, new: NodeId) -> NodeId
xmlReplaceNode.
pub fn add_attr( &mut self, elem: NodeId, name: &str, prefix: Option<&str>, value: &str, ) -> NodeId
pub fn push_ns_def(&mut self, elem: NodeId, prefix: Option<String>, uri: String)
Sourcepub fn xml_has_prop(&self, node: NodeId, name: &str) -> bool
pub fn xml_has_prop(&self, node: NodeId, name: &str) -> bool
xmlHasProp.
Sourcepub fn xml_unset_prop(&mut self, node: NodeId, name: &str) -> bool
pub fn xml_unset_prop(&mut self, node: NodeId, name: &str) -> bool
xmlUnsetProp.
Sourcepub fn xml_node_get_content(&self, id: NodeId) -> String
pub fn xml_node_get_content(&self, id: NodeId) -> String
xmlNodeGetContent — concatenate descendant text/CDATA.
Sourcepub fn xml_node_set_content(&mut self, id: NodeId, content: &str)
pub fn xml_node_set_content(&mut self, id: NodeId, content: &str)
xmlNodeSetContent — replace children with a single text node.
Sourcepub fn xml_is_blank_node(&self, id: NodeId) -> bool
pub fn xml_is_blank_node(&self, id: NodeId) -> bool
xmlIsBlankNode.
Sourcepub fn xml_search_ns(
&self,
node: NodeId,
prefix: Option<&str>,
) -> Option<String>
pub fn xml_search_ns( &self, node: NodeId, prefix: Option<&str>, ) -> Option<String>
xmlSearchNs — walk ancestors for a prefix binding.
Sourcepub fn xml_new_ns(&mut self, node: NodeId, href: &str, prefix: Option<&str>)
pub fn xml_new_ns(&mut self, node: NodeId, href: &str, prefix: Option<&str>)
xmlNewNs — add a namespace declaration on an element.
Sourcepub fn xml_set_ns(
&mut self,
node: NodeId,
href: Option<&str>,
prefix: Option<&str>,
)
pub fn xml_set_ns( &mut self, node: NodeId, href: Option<&str>, prefix: Option<&str>, )
xmlSetNs.
Sourcepub fn xml_copy_doc(&self) -> XmlDoc
pub fn xml_copy_doc(&self) -> XmlDoc
xmlCopyDoc — deep copy.
pub fn qname(&self, id: NodeId) -> String
pub fn children(&self, id: NodeId) -> NodeIter<'_> ⓘ
pub fn attrs(&self, id: NodeId) -> NodeIter<'_> ⓘ
pub fn len(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for XmlDoc
impl RefUnwindSafe for XmlDoc
impl Send for XmlDoc
impl Sync for XmlDoc
impl Unpin for XmlDoc
impl UnsafeUnpin for XmlDoc
impl UnwindSafe for XmlDoc
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