NextSibling - cXMLDOMAttribute

Returns a handle to the next sibling of this node in the parent's child list

Type: Function

Return Data Type: Handle

Parameters: None

Return Value

Returns an object handle to the next node, zero if no more nodes.


Syntax
Function NextSibling Returns Handle

Call: Get NextSibling to HandleVariable


Description

NextSibling returns a handle to the next sibling of this node in the parent's child list. The message is sent to the child objects (i.e. the siblings - not the parent).

Get FirstChild of hoRoot to hoNode // get the first node
While (hoNode<>0)
    Send ShowInformation hoNode
    Get NextSibling of hoNode to hoNextNode // now get next sibling node
    Send Destroy of hoNode     // Important: get rid of the previous node object
    Move hoNextNode to hoNode
Loop

You can use the NextNode to find the next sibling and destroy the current node. NextNode is usually the preferred method. Here is the same example using NextNode.

Get FirstChild of hoRoot to hoNode // get the first node
While (hoNode<>0)
    Send ShowInformation hoNode
    Get NextNode of hoNode to hoNode // now get next sibling node
Loop

See Also

NextNode | FirstChild | PreviousSibling | LastChild