Struct libxml::tree::Document [−][src]
pub struct Document(_);
A libxml2 Document
Methods
impl Document
[src]
impl Document
pub fn new() -> Result<Self, ()>
[src]
pub fn new() -> Result<Self, ()>
Creates a new empty libxml2 document
pub fn doc_ptr(&self) -> xmlDocPtr
[src]
pub fn doc_ptr(&self) -> xmlDocPtr
Obtain the underlying libxml2 xmlDocPtr
for this Document
pub fn new_ptr(doc_ptr: xmlDocPtr) -> Self
[src]
pub fn new_ptr(doc_ptr: xmlDocPtr) -> Self
Creates a new Document
from an existing libxml2 pointer
pub fn save_file(&self, filename: &str) -> Result<c_int, ()>
[src]
pub fn save_file(&self, filename: &str) -> Result<c_int, ()>
Write document to filename
pub fn get_root_element(&self) -> Option<Node>
[src]
pub fn get_root_element(&self) -> Option<Node>
Get the root element of the document
pub fn set_root_element(&mut self, root: &Node)
[src]
pub fn set_root_element(&mut self, root: &Node)
Sets the root element of the document
pub fn import_node(&mut self, node: &mut Node) -> Result<Node, ()>
[src]
pub fn import_node(&mut self, node: &mut Node) -> Result<Node, ()>
Import a Node
from another Document
pub fn to_string(&self, format: bool) -> String
[src]
pub fn to_string(&self, format: bool) -> String
Serializes the Document
pub fn node_to_string(&self, node: &Node) -> String
[src]
pub fn node_to_string(&self, node: &Node) -> String
Serializes a Node
owned by this `Document
pub fn create_processing_instruction(
&mut self,
name: &str,
content: &str
) -> Result<Node, ()>
[src]
pub fn create_processing_instruction(
&mut self,
name: &str,
content: &str
) -> Result<Node, ()>
Creates a node for an XML processing instruction
pub fn as_node(&self) -> Node
[src]
pub fn as_node(&self) -> Node
Cast the document as a libxml Node
pub fn dup(&self) -> Result<Self, ()>
[src]
pub fn dup(&self) -> Result<Self, ()>
Duplicates the libxml2 Document into a new instance
pub fn dup_from(&mut self, source: &Self) -> Result<(), ()>
[src]
pub fn dup_from(&mut self, source: &Self) -> Result<(), ()>
Duplicates a source libxml2 Document into the empty Document self
Trait Implementations
impl Clone for Document
[src]
impl Clone for Document
fn clone(&self) -> Document
[src]
fn clone(&self) -> Document
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Drop for Document
[src]
impl Drop for Document