Node

<code>Node</code> defines the polymorphic behavior for all XML nodes in a dom tree.

A node can be output as its XML format, can be detached from its position in a document and can have XPath expressions evaluated on itself.

A node may optionally support the parent relationship and may be read only.

Constructors

this
this()
Undocumented in source.
this
this(NodeType type)
Undocumented in source.
this
this(string name, NodeType type)
Undocumented in source.

Members

Functions

getName
string getName()

<p> <code>getName</code> returns the name of this node. This is the XML local name of the element, attribute, entity or processing instruction. For CDATA and Text nodes this method will return null. </p>

getParent
Element getParent()

<p> <code>getParent</code> returns the parent <code>Element</code> if this node supports the parent relationship or null if it is the root element or does not support the parent relationship. </p>

getType
NodeType getType()

Returns the code according to the type of node. This makes processing nodes polymorphically much easier as the switch statement can be used instead of multiple if (instanceof) statements.

setName
void setName(string name)

<p> Sets the text data of this node or this method will throw an <code>UnsupportedOperationException</code> if it is read-only. </p>

setParent
void setParent(Element parent)

<p> <code>setParent</code> sets the parent relationship of this node if the parent relationship is supported or does nothing if the parent relationship is not supported. </p>

Variables

m_name
string m_name;
Undocumented in source.
m_parent
Element m_parent;
Undocumented in source.
m_type
NodeType m_type;
Undocumented in source.

Meta