#include <LibXMLHelper.h>
Public Member Functions | |
| LibXMLHelper () | |
| virtual | ~LibXMLHelper () |
| std::string | attribute (xmlNode *node, const std::string &name, const std::string &defaultValue=std::string()) const |
| std::string | content (xmlNode *nodePtr) const |
| The TEXT content of the node and all child nodes Read the value of a node, this can be either the text carried directly by this node if it's a TEXT node or the aggregate string of the values carried by this node child's (TEXT and ENTITY_REF). Entity references are substituted. | |
| std::string | name (const xmlNode *nodePtr) const |
| bool | isElement (const xmlNode *nodePtr) const |
| std::string | positionInfo (const xmlNode *nodePtr) const |
| LibXMLHelper::LibXMLHelper | ( | ) |
The default constructor will return an object that does not look into the namespace properties of the nodes. Later, another constructor will be added that takes a list of namespaces as parameters (and maybe also character encoding information), and all nodes of different namespaces will be ignored (i.e., attributes will not be used, and for elements in different namespaces isElement() will return false).
| virtual LibXMLHelper::~LibXMLHelper | ( | ) | [virtual] |
Destructor
| std::string LibXMLHelper::attribute | ( | xmlNode * | node, | |
| const std::string & | name, | |||
| const std::string & | defaultValue = std::string() | |||
| ) | const |
Fetch an attribute
| node | the xmlNode | |
| name | name of the attribute | |
| defaultValue | the value to return if this attribute does not exist |
| std::string LibXMLHelper::content | ( | xmlNode * | nodePtr | ) | const |
The TEXT content of the node and all child nodes Read the value of a node, this can be either the text carried directly by this node if it's a TEXT node or the aggregate string of the values carried by this node child's (TEXT and ENTITY_REF). Entity references are substituted.
| nodePtr | the xmlNode |
| std::string LibXMLHelper::name | ( | const xmlNode * | nodePtr | ) | const |
The name of the node
| nodePtr | the xmlNode |
| bool LibXMLHelper::isElement | ( | const xmlNode * | nodePtr | ) | const |
returns whether this is an element node (and not, e.g., a attribute or namespace node)
| nodePtr | the xmlNode |
| std::string LibXMLHelper::positionInfo | ( | const xmlNode * | nodePtr | ) | const |
returns a string that identifies the position of an element nodes e.g. for error messages
| nodePtr | the xmlNode |
1.5.3