Defined in file: hzDocument.h

These form the nodes in the hzXmlObj tree (the XML document)

Constructors/Detructors

hzXmlNode*hzXmlNode(void)
void~hzXmlNode(void)

Public Methods:

hzEcodeAddNode(hzXmlNode* pNode)Add the supplied node to the calling node's list of child node. This is achieved by either making m_pChildren equal to the supplied node (where the calling node does not yet have chidren) or by seeking to the end of the list and then appending (each of the existing children will have its m_pSibling pointer set to the next child).
uint32_tAnti(void)
voidClear(void)
voidExport(hzChain& Z)Export the combined value of this node to the supplied chain. This function is non-recursive allowing it to clear the chain at the outset. Because nodes have child nodes, the process is recursive so this function calls Export_r to effect the export. This will incorporate the node name and attributes, the direct content of the node including subtags. Thsis function was introduced for the purpose of establishing an MD5 value for the node. This is used in large XML config files in which many resources are configured, to determine which resources have changed and so need to be reloaded. Returns: None
voidExport_r(hzDocXml* pDoc)hzChain& Z, uint32_t& relLine, Export the combined value of this node to the supplied chain. Please note this is a recursive process so the chain is not cleared. Note also the caller must provide a reference to a 32-bit unsigned value for tracking the relative line number. This number should be set to the line number of the original node. This will incorporate the node name and attributes, the direct content of the node including subtags. This function was introduced for the purpose of establishing an MD5 value for the node. This is used in large XML config files in which many resources are configured, to determine which resources have changed and so need to be reloaded. Returns: None
hzStringFilename(void)This provides the name of the XML file used as the source of XML this XML node is a part. This is useful in diagnosing config errors as config files can be spread accross more than one XML file (eg SiteServer configs). Arguments: None
hzXmlNode*FindSubnode(const char* srchExp)From the current node (the node used to call this member function), find all sub-nodes matching the supplied criteria. The critieria will be that required to uniquely identify a tag and optionally that required to specify a tag attribute and optionally that required to specify a value for the tag or attribute. The convention is to use the :: symbol between tag levels where these are needed and the -> symbol to name the tag attribute and the = symbol to specify a value. Criteria can thus be of the forms:- 1) tagname 2) level0tagname...levelNtagname 3) ....tagname="some value" 4) ....tagname->attribute 5) ....tagname->attribute="some value" The criteria must only serve to identify a single tag or tag attribute. All nodes matching matching this criteria are then compiled into the supplied hzVect. Note that only the nodes will be placed in the vector and not the attributes. The application will have to use the hzXmlNode member fuctions for accessing attributes and there values if these are required. Pointer to subnode matching supplied criteria NULL If no subnode matches
voidFindSubnodes(hzVect<hzXmlNode*>& result)const char* srchExp, From the current node (the node used to call this member function), find all sub-nodes matching the supplied criteria. Warning! This function has been known to cause a lot of confusion. This function does not simply locate nodes that are children of the calling node whose name matches the supplied criteria. The aim is to locate descenant nodes, however far down the tree they are. Returns: None
uint32_tFirstChildId(void)
const char*Fname(void)This provides the name of the XML file used as the source of XML this XML node is a part. This is useful in diagnosing config errors as config files can be spread accross more than one XML file (eg SiteServer configs). Arguments: None
hzXmlNode*GetFirstChild(void)
hzDocXml*GetHostDoc(void)
uint32_tGetNoAttrs(void)
uint32_tGetUid(void)
hzXmlNode*Init(hzDocXml* pHostDoc)hzXmlNode* pParent, hzString& name, uint32_t nLineNo, uint32_t nCol, bool bXmlesce, Initialize a hzXmlNode, insert it into the host document's array of nodes and return the in-situ pointer Pointer to node in-situ
boolIsAncestor(hzXmlNode* candidate)Is the candidate node an ancestor of this node?
boolIsXmlesce(void)
uint32_tLevel(void)
uint32_tLine(void)
boolNameEQ(const char* testval)
hzXmlNode*Parent(void)
uint32_tParentId(void)
hzEcodeSelectSubnodes(hzVect<hzXmlNode*>& result)hzMapM<hzString,hzXmlNode*>& allsubnodes, const char* criteria, Select from a map of subnodes (from a call to hzXmlNode::MapAllSubnodes) according to the supplied criteria. The criteria is of the form tagname...tagname->param=value in which the parameter value could be missing, both the parameter and the value coule be missing and the tagname may be singular. The tagname (if multiple) will be applied in reverse order. A node will be selected only if it's name matches the last tagname and it has a parent whose name matches the last but one tagname and a grandparent whose name matches the last but two tagname and so on until there are no more tagnames to apply. 1) tagname 2) level0tagname...levelNtagname 3) ....tagname="some value" 4) ....tagname->attribute 5) ....tagname->attribute="some value" The criteria must only serve to identify a single tag or tag attribute. All nodes matching matching this criteria are then compiled into the supplied hzVect. Note that only the nodes will be placed in the vector and not the attributes. The application will have to use the hzXmlNode member fuctions for accessing attributes and there values if these are required.
voidSetCDATA(hzChain& Z)Set content supplied as CDATA Returns: None
voidSetContent(hzChain& Z)SetContent is called by hzDocXml::Load() once the node content has been established by encountering the anti-tag. Technically, the content of a node is the opening tag, the anti-tag and absoultely everything in-between. That is not how HadronZoo chooses to see it. The content does not include eiher the tag or anti-tag and text content is stipped of leading and trailing whitespace. This unifies the approach between single and multi-line tags. Returns: None
hzEcodeSetPretext(hzChain& Z)Set the XML node's pretext value to that of the supplied chain.
hzXmlNode*Sibling(void)
uint32_tSiblingId(void)
uint32_tUid(void)
const char*Xlate(uint32_t strNo)
hzXmlNode*_findsubnode(bool& bMatch)hzString& name, hzString& attr, hzString& value, Test if this node has the correct name and if not, attemp to find a subnode that does. If no match on name return NULL, else return the node. Once a node matching the name has been found, it is tested for any supplied attr and value criteria. If these match (or are not supplied), bMatch is set true. In all other scenarios bMatch is set false. Pointer to subnode
void_setanti(uint32_t lineNo)
uint32_t_testnode(hzVect<hzXmlNode*>& tmpResult)const char* srchExp, uint32_t& nLimit, Support funcion for FindSubnodes() Split up first part of criteria (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 criteria that are found at the lowest level
const char*txtName(void)
const char*txtPtxt(void)

Overloaded operators:

hzXmlNode&operator=(hzXmlNode& op)

Member Variables:

uint32_tm_ChildrenFirst child (in a series of children)
hzStringm_NameNode name
uint32_tm_ParentParent node. This will be 0 in the root node.
hzStringm_PtxtNode pre-text
uint32_tm_SiblingNext node (in the series of children). This will be 0 in the last child node.
uint32_tm_UidUnique id
uint16_tm_bXmlesceNode may contain HTML tags as part of the content
hzStringm_fixContentContents of the tag (after loading if m_tmpContent is small)
uint32_tm_nAntiLine number of anti-tag
uint16_tm_nAttrsNumber of attributes
uint16_tm_nColColumn of node within line wthin document
uint16_tm_nLevelLevel of node (root node is 0)
uint32_tm_nLineLine number of tag
hzDocXml*m_pHostDocHost XML document