Struct xmltree::Element [] [src]

pub struct Element {
    pub name: String,
    pub attributes: HashMap<String, String>,
    pub children: Vec<Element>,
    pub text: Option<String>,
}
[]

Represents an XML element.

Fields

name

The name of the Element. Does not include any namespace info

attributes

The Element attributes

children

Children

text

The text data for this element

Methods

impl Element

fn parse<R: Read>(r: R) -> Element[]

Parses some data into an Element

Panics

Panics on error or other unhandled condition

fn write<W: Write>(&self, w: W)[]

Writes out this element as the root element in an new XML document

fn get_child<K>(&self, k: K) -> Option<&Element> where String: PartialEq<K>[]

Attempts to find a child element with the given name

fn get_mut_child<'a, K>(&'a mut self, k: K) -> Option<&'a mut Element> where String: PartialEq<K>[]

Mutable version of the above API

Trait Implementations

Derived Implementations

impl Eq for Element

impl PartialEq for Element

fn eq(&self, __arg_0: &Element) -> bool

fn ne(&self, __arg_0: &Element) -> bool

impl Debug for Element

fn fmt(&self, __arg_0: &mut Formatter) -> Result