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_tAnti(void)
voidFindSubnodes(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_tGetUid(void)
hzEcodeInit(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_tLevel(void)
uint32_tLine(void)
hzStringName(void)
hzHtmElem*Parent(void)
hzHtmElem*Sibling(void)
hzHtagtypeType(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_tm_ChildrenSub nodes of this node
hzStringm_NameName of this tag
uint32_tm_ParentParent node (for root this is a hzDocHtml, all other nodes this is a hzHtmElem)
uint32_tm_SiblingNext node (in the series m_Chridren belonging to the parent of this)
hzHtagtypem_TypeType of HTML tag
uint32_tm_UidUnique id (within page)
hzStringm_fixContentContents of the tag (after loading if n_tempContent is small)
uint32_tm_nAntiLine number of anti-tag in the page source
uint16_tm_nAttrsNumber of parameters (not set until page load complete)
uint16_tm_nLevelLevel of node (root node is 0)
uint32_tm_nLineLine number of tag in the page source
uint32_tm_nSubnodesNumber of sub-nodes (not set until page load complete)
hzDocHtml*m_pHostDocHost document
hzChainm_tmpContentContent of this tag