Struct xml::Element [] [src]

pub struct Element {
    pub name: String,
    pub ns: Option<String>,
    pub attributes: HashMap<(String, Option<String>), String>,
    pub children: Vec<Xml>,
    // some fields omitted
}

A struct representing an XML element

Fields

The element's name

The element's namespace

The element's attributes

The element's child Xml nodes

Methods

impl Element
[src]

Create a new Element, with specified name and namespace. Attributes are specified as a Vec of (name, namespace, value) tuples.

Returns the character and CDATA contained in the element.

Gets an attribute with the specified name and namespace. When an attribute with the specified name does not exist None is returned.

Sets the attribute with the specified name and namespace. Returns the original value.

Remove the attribute with the specified name and namespace. Returns the original value.

Gets the first child Element with the specified name and namespace. When no child with the specified name exists None is returned.

Get all children Element with the specified name and namespace. When no child with the specified name exists an empty vetor is returned.

Appends a child element. Returns a reference to the added element.

Appends a child element. Returns a mutable reference to self.

Appends characters. Returns a mutable reference to self.

Appends CDATA. Returns a mutable reference to self.

Appends a comment. Returns a mutable reference to self.

Appends processing information. Returns a mutable reference to self.

Trait Implementations

impl Clone for Element
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Element
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Debug for Element
[src]

Formats the value using the given formatter.

impl Display for Element
[src]

Formats the value using the given formatter. Read more

impl FromStr for Element
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more