Defined in file: hzDocument.h
hzHtmlElem is the internal manifestation of a HTML tag, within a HTML document. Note that the parent node, first child and next sibling, are represented by 32-bit unsigned numbers. These are addresses in the document hzStrRepos (dictionary). To access the dictionary, each HTML tag contains a pointer back to the host document which holds the dictionary.
Constructors/Detructors
| hzHtmElem* | hzHtmElem | (void) | |
| void | ~hzHtmElem | (void) |
Public Methods:
| uint32_t | Anti | (void) | |
| void | 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 Returns: None |
| hzHtmElem* | GetFirstChild | (void) | |
| hzDocHtml* | GetHostDoc | (void) | |
| hzDocHtml* | GetTree | (void) | Return the HTML document whose tree of HTML elemnents this hzHtmElem is a part. We start at the current node and follow the parentage all the way back to the base of the tree. Arguments: None Pointer to root node of the tree to which the current node (element) belongs |
| uint32_t | GetUid | (void) | |
| hzEcode | Init | (hzDocHtml* pRoot)hzHtmElem* pParent, hzString& tagname, hzHtagtype type, uint32_t id, uint32_t line, | Initialize a HTML element (tag) to the parent element (if any), the tag type. Set also the id and line number (within the HTML in question) |
| uint32_t | Level | (void) | |
| uint32_t | Line | (void) | |
| hzString | Name | (void) | |
| hzHtmElem* | Parent | (void) | |
| hzHtmElem* | Sibling | (void) | |
| hzHtagtype | Type | (void) | |
| hzEcode | _addnode | (hzHtmElem* pNode) | Adds an element as a subnode of this. Subnodes are always appended. |
| void | _setanti | (uint32_t line) | |
| uint32_t | _testnode | (hzVect<hzHtmElem*>& tmpResult)const char* srchExp, uint32_t& nLimit, uint32_t nLevel, bool bLog, | Recursive support function to the non-recursive FindSubnodes function. Split up first part of search expression (up to first period or null terminator), to a node/tag name and if present, a content speciifer (="some_value"), an attribute name (->"attr_name") an attribute content specifer. We now apply the test to the current node and when required, to the children. We do not operate where nodes are at a higher level than the limit. This is because the FindSubnodes function is looking for the set of nodes matching the search expression that are found at the lowest level |
Member Variables:
| uint32_t | m_Children | Sub nodes of this node | |
| hzString | m_Name | Name of this tag | |
| uint32_t | m_Parent | Parent node (for root this is a hzDocHtml, all other nodes this is a hzHtmElem) | |
| uint32_t | m_Sibling | Next node (in the series m_Chridren belonging to the parent of this) | |
| hzHtagtype | m_Type | Type of HTML tag | |
| uint32_t | m_Uid | Unique id (within page) | |
| hzString | m_fixContent | Contents of the tag (after loading if n_tempContent is small) | |
| uint32_t | m_nAnti | Line number of anti-tag in the page source | |
| uint16_t | m_nAttrs | Number of parameters (not set until page load complete) | |
| uint16_t | m_nLevel | Level of node (root node is 0) | |
| uint32_t | m_nLine | Line number of tag in the page source | |
| uint32_t | m_nSubnodes | Number of sub-nodes (not set until page load complete) | |
| hzDocHtml* | m_pHostDoc | Host document | |
| hzChain | m_tmpContent | Content of this tag |