Struct rquery::Document [] [src]

pub struct Document {
    // some fields omitted
}

The DOM tree representation of the parsed document.

Methods

impl Document
[src]

fn new_from_xml_stream<R: Read>(stream: R) -> Result<Document, DocumentError>

Creates a new document from a byte stream.

fn new_from_xml_string(string: &str) -> Result<Document, DocumentError>

Creates a new document from a string.

fn new_from_xml_file(filename: &str) -> Result<Document, DocumentError>

Creates a new document from a file.

fn number_of_elements(&self) -> usize

Returns the total number of elements in the document.

fn select_all<'a>(&'a self, selector: &'a str) -> Result<Box<Iterator<Item=&'a Element> + 'a>, ()>

Searches the document for elements matching the given CSS selector.

fn select<'a>(&'a self, selector: &'a str) -> Result<&'a Element()>

Just like select_all but only returns the first match.