Node.Parent

This page contains reference documentation for the Parent function. This function returns a node's parent.

Prototype

Group Parent()

Examples

Examples are as follows:

// Copy the path to any node to a string.

function string GetPathToNode( Node node )
{
   string path = "/" + node.Name;
   node = node.Parent();
   while ( node && node.Parent() )
   {
      path = "/" + node.Name + path;
      node = node.Parent();
   }
   return path;
}

// Construct the parent and grandparent for a node.

Node parentNode = node.Parent();
Node grandParent = parentNode.Parent();



Working Sample Code

For sample code: