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-TYPE | hzDocXml | (void) | |
| void | ~hzDocXml | (void) | |
| NULL-TYPE | ~hzDocXml | (void) |
Public Methods:
| void | AddXmlesce | (hzString& tagname) | |
| void | Clear | (void) | Deletes all nodes from XML tree Arguments: None Returns: None |
| hzEcode | Export | (hzChain& Z) | Exports the in-memory XML document as XML. Place resulting text in the supplied chain |
| hzEcode | Export | (hzString& fpath) | Exports the in-memory XML document as XML. Place resulting text in the supplied filepath |
| hzString | Filename | (void) | |
| hzEcode | FindNodes | (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) | |
| hzString | GetValue | (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. |
| hzEcode | Load | (hzChain& Z) | Loads an XML document supplied as a chain into a tree of XML nodes |
| hzEcode | Load | (const char* fpath) | Loads an XML document into a tree of XML nodes |
| void | SetXmlesce | (bool bXmlesce) | |
| hzDoctype | Whatami | (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 .. |
| void | listnodes | (void) | List all nodes in this XML document for diagnostic purposes Arguments: None Returns: None |
Member Variables:
| uint32_t | m_FileEpoch | Modified time of loaded file (optional) | |
| hzString | m_Filename | Full path of loaded file (optional) | |
| hzMapM<hzString,uint32_t> | m_NodesName | 1:many strings (tag names) to node ids | |
| hzMapM<uint32_t,uint32_t> | m_NodesPar | 1:many parent nodes (node uid) to child node ids | |
| hzSet<hzString> | m_Xmlesce | List 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_arrNodes | All nodes within document | |
| uint32_t | m_bXmlesce | Treat all legal HTML tag/antitags as part of node content | |
| hzXmlNode* | m_pRoot | All tags found on level 0 |