Defined in file: hzDocument.h

Derivative of: hzDocument

The XML tree. This is usually populated by reading a single XML file

Constructors/Detructors

hzDocXml*hzDocXml(void)
NULL-TYPEhzDocXml(void)
void~hzDocXml(void)
NULL-TYPE~hzDocXml(void)

Public Methods:

voidAddXmlesce(hzString& tagname)
voidClear(void)Deletes all nodes from XML tree Arguments: None Returns: None
hzEcodeExport(hzChain& Z)Exports the in-memory XML document as XML. Place resulting text in the supplied chain
hzEcodeExport(hzString& fpath)Exports the in-memory XML document as XML. Place resulting text in the supplied filepath
hzStringFilename(void)
hzEcodeFindNodes(hzVect<hzXmlNode*>& Nodes)const char* srchExp, Find all nodes within an XML document meeting the supplied search expression. The critieria MUST as a minimum, specify the name of the XML nodes sought. The criteria can optionally specify an attribute the node must contain and can go on to require that the attribute has a particular value. In addition, node ancestry may be specified. The notation convention is to use the :: symbol between tags to show ancestry, the -> symbol to name the tag attribute and the = symbol to specify a tag attribute value. Criteria can thus be of the forms:- 1) tagname 2) level_N-1_tagname::level_N_tagname 3) ...tagname->attribute_name 4) ...tagname->attribute_name=attribute_value All nodes matching this criteria are added to the supplied vector and appear in their order of incidence in the XML document.
const char*Fname(void)
hzXmlNode*GetNode(uint32_t nodeId)Find node by node id (position in document) Argument: nodeId
hzXmlNode*GetRoot(void)
hzStringGetValue(hzXmlNode* pRoot)hzString& Nodename, hzString& Info, Using a supplied starting node (arg 1) to define a sub-tree of the current document's tree of XML nodes (tags), obtain the set of nodes whose name matches the supplied node-name (arg 2). Then, depending on the value of the supplied control string (arg 3), build the string to be returned by value, as one of the following:- 1) Info="aggr". Aggregate the content of all the matching nodes. 2) Info="node". Take the content from the first matching node. 3) Other value. Take this value as the attribute name. The result will then be the attribute value (if found) of the first matching node.
hzEcodeLoad(hzChain& Z)Loads an XML document supplied as a chain into a tree of XML nodes
hzEcodeLoad(const char* fpath)Loads an XML document into a tree of XML nodes
voidSetXmlesce(bool bXmlesce)
hzDoctypeWhatami(void)
int32_t_proctagopen(hzXmlNode** ppChild)hzXmlNode* pParent, hzChain::Iter& ci, Determine if the current char (in the working chain) amounts to the start of an XML tag instance (node). If is is then a new node is allocated and the pointer to this returned to the caller (hzDocXml::Load()) via the first argument. If the current char in the chain does not amount to the start of the tag ..
voidlistnodes(void)List all nodes in this XML document for diagnostic purposes Arguments: None Returns: None

Member Variables:

uint32_tm_FileEpochModified time of loaded file (optional)
hzStringm_FilenameFull path of loaded file (optional)
hzMapM<hzString,uint32_t>m_NodesName1:many strings (tag names) to node ids
hzMapM<uint32_t,uint32_t>m_NodesPar1:many parent nodes (node uid) to child node ids
hzSet<hzString>m_XmlesceList of tags whose nodes are permitted to contain HTML data. The node may still contain normal XML subnodes but any tag with a name that is a legal HTML tag - will be treated as HTML.
hzArray<hzXmlNode>m_arrNodesAll nodes within document
uint32_tm_bXmlesceTreat all legal HTML tag/antitags as part of node content
hzXmlNode*m_pRootAll tags found on level 0