Class Node

Superclasses :
lang::Object
Subclasses :
xml::CData
xml::Comment
xml::DocType
xml::Document
xml::Element
xml::ProcessingInstruction
xml::Tag
xml::XmlDecl
Package :
xml

This is the base class for all objects in the document, including the document itself.

Source

Class summary
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
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() get_type() initially() print_structure(f, indent, flags) remove_whitespace_children()
Variables defined in this class
children parent

Method detail

add_child(obj, pos)

Add a child at the given pos. If pos is not specified, the child is appended to the end.
Parameters :
obj - - either a string or a Node subclass
pos - - the pos to insert
Source

add_string(s, pos)

Add a string at the given pos. If pos is not specified, the child is appended to the end.

This differs from the above add_child() method in that adjacent strings will be compacted together to form one longer string.

Parameters :
s - - a string
pos - - the pos to insert
Source

do_trim(s)

Trim xml::xml_space chars from both ends of the given element
Source

generate_nodes()

Generate all the nodes in this Node
Source

get_children()

Return the children of this node.
Source

get_children_no_whitespace()

Get a copy list of the children elements, but with any whitespace strings elements removed. This leaves the children list intact.
Source

get_parent()

Return the parent Node of this Node
Source

get_string_content()

Get the string content of the node, which is the catenation of all the string children.
Source

get_trimmed_children()

Just like get_children_no_whitespace(), but this trims any string children left in the list.
Source

get_trimmed_string_content()

Get the trimmed string content of the node, which is the catenation of all the trimmed string children.
Source

get_type()

Return a string describing the type of the node.
Source

initially()


print_structure(f, indent, flags)

Print the structure to the given file, for debugging.
Source

remove_whitespace_children()

Clean out any whitespace-only strings from the children list.
Source

Variable detail

children


parent