Is the candidate node an ancestor of this node?

Return TypeFunction nameArguments
boolhzXmlNode::IsAncestor(hzXmlNode*,)

Declared in file: hzDocument.h
Defined in file : hzDocXml.cpp

Function Logic:

0:START 1:unknown 2:Return false 3:unknown 4:Return false 5:unknown 6:Return pNode==candidate?true:false

Function body:

bool hzXmlNode::IsAncestor (hzXmlNode* candidate)
{
   //  Is the candidate node an ancestor of this node?
   //  
   //  Arguments: 1) candidate The XML node to be tested as an ancestor of this node
   //  
   //  Returns: True If the candidate node is an ancestor of this
   //     False Otherwise
   hzXmlNode*  pNode ;         //  XML node pointer
   //  This node cannot have a non-ancestor.
   if (!candidate)
       return false ;
   //  If this node is at the same or lower level than the candidate then the candidate cannot be an ancestor of this node.
   if (m_nLevel <&eq; candidate->m_nLevel)
       return false ;
   //  Starting at the this node's level we work back to the candidate node's level.
   for (pNode = this ; pNode->m_nLevel > candidate->m_nLevel ; pNode = pNode->Parent()) ;
   //  Now pNode is on the same level as the candidate. If the pNode and the candidate are the same node, the candidate is an ancestor
   //  of this node.
   return pNode == candidate ? true : false ;
}