Struct libxml::tree::Document
[−]
[src]
pub struct Document { pub doc_ptr: *mut c_void, }
A libxml2 Document
Fields
doc_ptr: *mut c_void
libxml's DocumentPtr
Methods
impl Document
[src]
fn new() -> Result<Self, ()>
[src]
Creates a new empty libxml2 document
fn new_ptr(doc_ptr: *mut c_void) -> Self
[src]
Creates a new Document
from an existing libxml2 pointer
fn save_file(&self, filename: &str) -> Result<c_int, ()>
[src]
Write document to filename
fn get_root_element(&self) -> Node
[src]
Get the root element of the document
fn set_root_element(&mut self, root: &Node)
[src]
Sets the root element of the document
fn import_node(&self, node: &Node) -> Option<Node>
[src]
Import a Node
from another Document
fn to_string(&self, format: bool) -> String
[src]
Serializes the Document
fn node_to_string(&self, node: &Node) -> String
[src]
Serializes a Node
owned by this `Document
fn create_processing_instruction(
&mut self,
name: &str,
content: &str
) -> Result<Node, ()>
[src]
&mut self,
name: &str,
content: &str
) -> Result<Node, ()>
Creates a node for an XML processing instruction
fn as_node(&self) -> Node
[src]
Cast the document as a libxml Node