All Frameworks Class Hierarchy This Framework Previous Next Indexes
XMLParser Interface CATIDOMTreeWalker
System.IUnknown
|
+---System.IDispatch
|
+---System.CATBaseUnknown
|
+---CATIDOMTreeWalker
Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.
interface CATIDOMTreeWalker
Interface used to navigate a document tree or
subtree using the view of the document defined by their
GetWhatToShow flags and filter (if any).
Any function which
performs navigation using a CATIDOMTreeWalker will automatically support any view defined by a
CATIDOMTreeWalker.
Omitting nodes from the logical view of a subtree can result in a
structure that is substantially different from the same subtree in the
complete, unfiltered document. Nodes that are siblings in the
CATIDOMTreeWalker view may be children of different, widely separated nodes in the original view. For instance, consider a
CATIDOMNodeFilter that skips all nodes except for Text nodes and the root node of a document. In the logical view that results, all text
nodes will be siblings and appear as direct children of the root node, no
matter how deeply nested the structure of the original document.
See also the Document Object Model (DOM) Level 2 Traversal and Range Specification.
Method Index
- o
FirstChild(CATIDOMNode_var&)
- Moves the CATIDOMTreeWalker to the first visible child of the
current node, and returns the new node.
- o
GetCurrentNode(CATIDOMNode_var&)
- Retrieves the node at which the CATIDOMTreeWalker is currently positioned.
- o
GetExpandEntityReferences(CATBoolean&)
- Retrieves the flag which determines whether the children of entity
reference nodes are visible to the CATIDOMTreeWalker.
- o
GetFilter(CATIDOMNodeFilter_var&)
- Retrieves the filter used to screen nodes.
- o
GetRoot(CATIDOMNode_var&)
- Retrieves the root node of the CATIDOMTreeWalker, as specified
when it was created.
- o
GetWhatToShow(unsigned int&)
- Retrieves the attribute which determines which node types are presented via the
CATIDOMTreeWalker.
- o
LastChild(CATIDOMNode_var&)
- Moves the CATIDOMTreeWalker to the last visible child of the
current node, and returns the new node.
- o
NextNode(CATIDOMNode_var&)
- Moves the CATIDOMTreeWalker to the next visible node in document
order relative to the current node, and returns the new node.
- o
NextSibling(CATIDOMNode_var&)
- Moves the CATIDOMTreeWalker to the next sibling of the current
node, and returns the new node.
- o
ParentNode(CATIDOMNode_var&)
- Moves to and returns the closest visible ancestor node of the current
node.
- o
PreviousNode(CATIDOMNode_var&)
- Moves the CATIDOMTreeWalker to the previous visible node in
document order relative to the current node, and returns the new
node.
- o
PreviousSibling(CATIDOMNode_var&)
- Moves the CATIDOMTreeWalker to the previous sibling of the
current node, and returns the new node.
- o
SetCurrentNode(CATIDOMNode_var&)
- Sets the node at which the CATIDOMTreeWalker is to be currently positioned.
Methods
o FirstChild
public virtual HRESULT FirstChild( | CATIDOMNode_var& | oFirstChild) = 0 |
-
Moves the CATIDOMTreeWalker to the first visible child of the
current node, and returns the new node. If the current node has no
visible children, returns NULL_var, and retains the current
node.
- Parameters:
-
- oFirstChild
- The new node, or NULL_var if the current node has no
visible children in the
CATIDOMTreeWalker 's logical view.
o GetCurrentNode
public virtual HRESULT GetCurrentNode( | CATIDOMNode_var& | oCurrentNode) = 0 |
-
Retrieves the node at which the CATIDOMTreeWalker is currently positioned.
Alterations to the DOM tree may cause the current node to no longer
be accepted by the
CATIDOMTreeWalker 's associated filter.
GetCurrentNode may also be explicitly set to any node, whether or not it is within the subtree specified by the
GetRoot node or would be accepted by the filter and
GetWhatToShow flags. Further traversal occurs relative to
GetCurrentNode even if it is not part of the current view, by applying the filters in the requested direction; if no traversal
is possible,
GetCurrentNode is not changed.
- Parameters:
-
- oCurrentNode
- the node at which the
CATIDOMTreeWalker is currently positioned.
o GetExpandEntityReferences
-
Retrieves the flag which determines whether the children of entity
reference nodes are visible to the CATIDOMTreeWalker. If false,
they and their descendants will be rejected. Note that this
rejection takes precedence over
GetWhatToShow and the filter, if any.
To produce a view of the document that has entity references
expanded and does not expose the entity reference node itself, use
the
GetWhatToShow flags to hide the entity reference node and set
GetExpandEntityReferences to true when creating the
CATIDOMTreeWalker. To produce a view of the document that has entity reference nodes but no entity expansion, use the
GetWhatToShow flags to show the entity reference node and set
GetExpandEntityReferences to false.
- Parameters:
-
- oResult
- the flag which determines whether the children of entity
reference nodes are visible to the
CATIDOMTreeWalker.
o GetFilter
public virtual HRESULT GetFilter( | CATIDOMNodeFilter_var& | oFilter) = 0 |
-
Retrieves the filter used to screen nodes.
- Parameters:
-
- oNodeFilter
- the filter used to screen nodes
o GetRoot
public virtual HRESULT GetRoot( | CATIDOMNode_var& | oRoot) = 0 |
-
Retrieves the root node of the CATIDOMTreeWalker, as specified
when it was created.
- Parameters:
-
- oRoot
- The root node of the
CATIDOMTreeWalker
o GetWhatToShow
public virtual HRESULT GetWhatToShow( | unsigned int& | oType) = 0 |
-
Retrieves the attribute which determines which node types are presented via the
CATIDOMTreeWalker. The available set of constants is defined in
the
CATIDOMNodeFilter interface. Nodes not accepted by
GetWhatToShow will be skipped, but their children may still be considered. Note that this skip takes precedence over the filter,
if any.
- Parameters:
-
- oType
- the attribute which determines which node types are presented via the
CATIDOMTreeWalker
o LastChild
public virtual HRESULT LastChild( | CATIDOMNode_var& | oLastChild) = 0 |
-
Moves the CATIDOMTreeWalker to the last visible child of the
current node, and returns the new node. If the current node has no
visible children, returns NULL_var, and retains the current
node.
- Parameters:
-
- oLastChild
- The new node, or NULL_var if the current node has no
children in the
CATIDOMTreeWalker 's logical view.
o NextNode
public virtual HRESULT NextNode( | CATIDOMNode_var& | oNextNode) = 0 |
-
Moves the CATIDOMTreeWalker to the next visible node in document
order relative to the current node, and returns the new node. If the
current node has no next node, or if the search for nextNode attempts
to step upward from the
CATIDOMTreeWalker 's
GetRoot node, returns NULL_var, and retains the current node.
- Parameters:
-
- oNextNode
- The new node, or NULL_var if the current node has no
next node in the
CATIDOMTreeWalker 's logical view.
o NextSibling
public virtual HRESULT NextSibling( | CATIDOMNode_var& | oNextSibling) = 0 |
-
Moves the CATIDOMTreeWalker to the next sibling of the current
node, and returns the new node. If the current node has no visible
next sibling, returns NULL_var, and retains the current node.
- Parameters:
-
- oNextSibling
- The new node, or NULL_var if the current node has no
next sibling. in the
CATIDOMTreeWalker 's logical view.
o ParentNode
public virtual HRESULT ParentNode( | CATIDOMNode_var& | oParentNode) = 0 |
-
Moves to and returns the closest visible ancestor node of the current
node. If the search for
ParentNode attempts to step upward from the
CATIDOMTreeWalker 's
GetRoot node, or if it fails to find a visible ancestor node, this method retains the
current position and returns NULL_var.
- Parameters:
-
- oParentNode
- The new parent node, or NULL_var if the current node
has no parent in the
CATIDOMTreeWalker 's logical view.
o PreviousNode
public virtual HRESULT PreviousNode( | CATIDOMNode_var& | oPreviousNode) = 0 |
-
Moves the CATIDOMTreeWalker to the previous visible node in
document order relative to the current node, and returns the new
node. If the current node has no previous node, or if the search for
previousNode attempts to step upward from the
CATIDOMTreeWalker 's
GetRoot node, returns NULL_var, and retains the current node.
- Parameters:
-
- oPreviousNode
- The new node, or NULL_var if the current node has no
previous node in the
CATIDOMTreeWalker 's logical view.
o PreviousSibling
public virtual HRESULT PreviousSibling( | CATIDOMNode_var& | oPreviousSibling) = 0 |
-
Moves the CATIDOMTreeWalker to the previous sibling of the
current node, and returns the new node. If the current node has no
visible previous sibling, returns NULL_var, and retains the
current node.
- Parameters:
-
- oPreviousSibling
- The new node, or NULL_var if the current node has no
previous sibling. in the
CATIDOMTreeWalker 's logical view.
o SetCurrentNode
public virtual HRESULT SetCurrentNode( | const CATIDOMNode_var& | iCurrentNode) = 0 |
-
Sets the node at which the CATIDOMTreeWalker is to be currently positioned.
- Parameters:
-
- iCurrentNode
- the node at which the
CATIDOMTreeWalker is to be currently positioned.
- Errors Returned:
-
Error Class |
Error Id |
Description |
CATDOMException | XMLParserERR_2205 |
NOT_SUPPORTED_ERR: Raised if an attempt is made to call
SetCurrentNode with a NULL_var argument. |
This object is included in the file: CATIDOMTreeWalker.h
If needed, your Imakefile.mk should include the module: CATXMLParserItf