protected int countAncestors ( ElemTemplateElement elem ) { int count = 0 ; while ( null != elem ) { count ++ ; elem = elem . getParentElem ( ) ; } return count ; }
Count the number of ancestors that a ElemTemplateElement has .