From the current node (the node used to call this member function), find all sub-nodes matching the supplied search expression. This function does not simply locate nodes that are children of the calling node whose name matches the supplied search expression. The aim is to locate descenant nodes, however far down the tree they are. Note: The search expression will be of the form of one or more name-value pairs as follows:- 1) name="some_name"; - Only applies if the element is given an id which is often not the case 2) type="html_tagtype"; - The element is of the right type, eg <table> 3) class="class_value"; - The element has the given class value 4) pname="param_name"; - The element has the parameter 4) pvalue="param_value"; - The element has the parameter value 6) cont="content_value"; - The element has contents of the given value Returns: None
| Return Type | Function name | Arguments |
|---|---|---|
| void | hzHtmElem::FindSubnodes | (hzVect<hzHtmElem*>&,const char*,bool,) |
Declared in file: hzDocument.h
Defined in file : hzDocHtml.cpp
Function Logic:
Function body:
void hzHtmElem::FindSubnodes (hzVect<hzHtmElem*>& result)const char* srchExp, bool bLog,
{
// From the current node (the node used to call this member function), find all sub-nodes matching the supplied search expression.
//
// This function does not simply locate nodes that are children of the calling node whose name matches the supplied search expression. The aim is
// to locate descenant nodes, however far down the tree they are.
//
// Note: The search expression will be of the form of one or more name-value pairs as follows:-
//
// 1) name="some_name"; - Only applies if the element is given an id which is often not the case
// 2) type="html_tagtype"; - The element is of the right type, eg <table>
// 3) class="class_value"; - The element has the given class value
// 4) pname="param_name"; - The element has the parameter
// 4) pvalue="param_value"; - The element has the parameter value
// 6) cont="content_value"; - The element has contents of the given value
//
// Arguments: 1) elements The vector of elements found and in thier actual order of incidence.
// 2) srchExp Search expression
// 3) bLog Set if detailed logging is required
//
// Returns: None
hzDocHtml* pTree ; // The Tree holding this node
uint32_t nLimit = 0; // Level limit
// Check we have a tree
pTree = GetTree() ;
if (!pTree)
Fatal("No tree - aborting\n") ;
// Recursively call _testnode
result.Clear() ;
_testnode(result, srchExp, nLimit, 0,bLog) ;
// threadLog("hzHtmElem::FindSubnodes: found %d results, set limit to %d\n", result.Count(), nLimit) ;
}