This section describes the XML specialization of the Node objects.
used throughout the DOM.
The XML implementation of the Node interface adds some methods
that are needed to manipulate specific features of XML documents
IDL Definition
interface XMLNode {
Node getParentXMLNode(in boolean expandEntities);
NodeIterator getChildXMLNodes(in boolean expandEntities);
boolean hasChildXMLNodes(in boolean expandEntities);
Node getFirstXMLChild(in boolean expandEntities);
Node getPreviousXMLSibling(in boolean expandEntities);
Node getNextXMLSibling(in boolean expandEntities);
EntityReference getEntityReference();
EntityDeclaration getEntityDeclaration();
};
|
Method getParentXMLNode()
Returns the parent of the given Node instance. If this
node is the root of the document object tree, or if this node
is not part of a document tree,
null
is returned.
expandEntities | TRUE if the view of the tree with parsed entities expanded
should be navigated, FALSE if the view without parsed entities
expanded should be navigated |
Node |
The parent of the node. |
This method throws no exceptions.
|
Method getChildXMLNodes()
Returns a NodeIterator object that will enumerate all children of
this node. If there are no children, an iterator that will return
no nodes is
returned. The content of the returned NodeIterator is
"live" in the sense that changes to the children of
the Node object that it was created from will be immediately
reflected in the nodes returned by the iterator; it is not
a static snapshot of the content of the Node. Similarly,
changes made to the nodes returned by the iterator will be
immediately reflected in the tree, including
the set of children of the Node that the NodeIterator was created
from.
expandEntities | TRUE if the view of the tree with parsed entities expanded
should be navigated, FALSE if the view without parsed entities
expanded should be navigated |
NodeIterator |
An iterator through the children of the node. |
This method throws no exceptions.
|
Method hasChildXMLNodes()
Returns true
if the node has any children,
false
if the node has no children at all. This
method exists both for convenience as well as to allow
implementations to be able to bypass object allocation, which
may be required for implementing getChildNodes()
.
expandEntities | TRUE if the view of the tree with parsed entities expanded
should be navigated, FALSE if the view without parsed entities
expanded should be navigated |
boolean |
True if the node has children. |
This method throws no exceptions.
|
Method getFirstXMLChild()
Returns the first child of a node. If there is no such
node, null
is returned.
expandEntities | TRUE if the view of the tree with parsed entities expanded
should be navigated, FALSE if the view without parsed entities
expanded should be navigated |
Node |
The first child of the node, or null. |
This method throws no exceptions.
|
Method getPreviousXMLSibling()
Returns the node immediately preceding the current node
in a breadth-first traversal of the tree. If there is no such
node, null
is returned.
expandEntities | TRUE if the view of the tree with parsed entities expanded
should be navigated, FALSE if the view without parsed entities
expanded should be navigated |
Node |
The the node immediately preceeding, or
null. |
This method throws no exceptions.
|
Method getNextXMLSibling()
Returns the node immediately following the current node
in a breadth-first traversal of the tree. If there is no such
node, null
is returned.
expandEntities | TRUE if the view of the tree with parsed entities expanded
should be navigated, FALSE if the view without parsed entities
expanded should be navigated |
Node |
The node immediately following, or null. |
This method throws no exceptions.
|
Method getEntityReference()
When navigating XML trees with expandedEntities set to TRUE,
the DOM programmer will on occasion get Nodes returned that are
part of the expansion of an entity rather than actual nodes in the
tree. This method returns the entity reference that generated
a particular node, or NULL if it was not part of an entity reference
expansion.
This method has no parameters.
|
EntityReference |
The entity reference whose expansion yields a given node,
or NULL if the node is not part of an entity expansion. |
This method throws no exceptions.
|
Method getEntityDeclaration()
When navigating XML trees with expandedEntities set to TRUE,
the DOM programmer will on occasion get Nodes returned that are
part of the expansion of an entity rather than actual nodes in the
tree. This method returns the declaration for the entity
reference that generated
a particular node, or NULL if it was not part of an entity reference
expansion.
This method has no parameters.
|
EntityDeclaration |
The entity declaration for a reference whose expansion yields a given node,
or NULL if the node is not part of an entity expansion. |
This method throws no exceptions.
|