LibXMLHelper Class Reference

Easy access to xmlNodes for C++. More...

#include <LibXMLHelper.h>

List of all members.

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


Detailed Description

Easy access to xmlNodes for C++.


Constructor & Destructor Documentation

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


Member Function Documentation

std::string LibXMLHelper::attribute xmlNode node,
const std::string &  name,
const std::string &  defaultValue = std::string()
const
 

Fetch an attribute

Parameters:
node the xmlNode
name name of the attribute
defaultValue the value to return if this attribute does not exist
Returns:
the value of the attribute

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.

Parameters:
nodePtr the xmlNode
Returns:
the content

bool LibXMLHelper::isElement const xmlNode nodePtr  )  const
 

returns whether this is an element node (and not, e.g., a attribute or namespace node)

Parameters:
nodePtr the xmlNode
Returns:
true if it is an element node

std::string LibXMLHelper::name const xmlNode nodePtr  )  const
 

The name of the node

Parameters:
nodePtr the xmlNode
Returns:
the name

std::string LibXMLHelper::positionInfo const xmlNode nodePtr  )  const
 

returns a string that identifies the position of an element nodes e.g. for error messages

Parameters:
nodePtr the xmlNode
Returns:
the position information


The documentation for this class was generated from the following file:
Generated on Fri Jun 16 15:51:35 2006 for liby2util by  doxygen 1.4.6