Class Element

Superclasses :
xml::Node
Subclasses :
xml::HtmlElement
xml::XmlElement
Package :
xml

Represents an element in the document.

Source

Class summary
Methods inherited from xml::Node
add_child(obj, pos) add_string(s, pos) do_trim(s) generate_nodes() get_children() get_children_no_whitespace() get_parent() get_string_content() get_trimmed_children() get_trimmed_string_content() remove_whitespace_children()
Variables inherited from xml::Node
children parent
Methods inherited from lang::Object
clone(seen) equals(other, seen) get_class() get_class_name() get_id() hash_code(depth, seen) is_instance(name) to_string(depth, seen)
Methods defined in this class
get_attribute(key) get_attributes() get_name(s) get_nth_element(n, s) get_type() initially() print_structure(f, indent, flags) search_children(s) search_tree(s) set_attribute(key, value) set_name(s)
Variables defined in this class
attributes name

Method detail

get_attribute(key)

Return the attribute for this tag, or &null if none specified.
Source

get_attributes()

Return the attributes map for this tag.
Source

get_name(s)

Return the name of the element
Source

get_nth_element(n, s)

Return the nth sub-element matching the given tag; if the tag is omitted just return the nth sub-element.
Fails :
if there is no such element.
Parameters :
n - the index to look for; 1 being the first.
s - the name of the sub-element.
Source

get_type()

Overrides get_type() in xml::Node
Returns "element"
Source

initially()

Overrides initially() in xml::Node

print_structure(f, indent, flags)

Overrides print_structure(f, indent, flags) in xml::Node
Print the structure to the given file
Source

search_children(s)

Generate the elements under this element, with the given name. If name is omitted, generate all the elements.
Parameters :
s - the name of the sub-elements.
Source

search_tree(s)

Search for all the Elements with the given tag name, recursively traversing the entire tree based at this node.
Parameters :
s - the name of the sub-elements.
Source

set_attribute(key, value)

Set an attribute for this tag.
Source

set_name(s)

Set the name of the tag
Source

Variable detail

attributes


name