MI - Fimex
Public Member Functions | Static Public Member Functions | List of all members
MetNoFimex::XMLDoc Class Reference

#include <fimex/XMLDoc.h>

Inheritance diagram for MetNoFimex::XMLDoc:

Public Member Functions

 XMLDoc (const std::string &filename)
 
virtual ~XMLDoc ()
 
XPathObjPtr getXPathObject (const std::string &xpath, xmlNodePtr node=0) const
 
void registerNamespace (const std::string &prefix, const std::string &uri)
 register a namespace for later xpath More...
 
std::string toString (const xmlNodePtr node)
 

Static Public Member Functions

static boost::shared_ptr< XMLDocfromFile (const std::string &filename)
 
static boost::shared_ptr< XMLDocfromString (const std::string &buffer, const std::string &url="")
 
static boost::shared_ptr< XMLDocfromURL (const std::string &url)
 

Detailed Description

a tiny wrapper around libxml dom and xpath reader with xml::include

Constructor & Destructor Documentation

MetNoFimex::XMLDoc::XMLDoc ( const std::string filename)
explicit

initialization of libxml and the xml config file

Parameters
filenamexml input-file
Exceptions
CDMExceptionif problems with libxml or problems with input-file
virtual MetNoFimex::XMLDoc::~XMLDoc ( )
virtual

Member Function Documentation

static boost::shared_ptr<XMLDoc> MetNoFimex::XMLDoc::fromFile ( const std::string filename)
static
static boost::shared_ptr<XMLDoc> MetNoFimex::XMLDoc::fromString ( const std::string buffer,
const std::string url = "" 
)
static
static boost::shared_ptr<XMLDoc> MetNoFimex::XMLDoc::fromURL ( const std::string url)
static
XPathObjPtr MetNoFimex::XMLDoc::getXPathObject ( const std::string xpath,
xmlNodePtr  node = 0 
) const

get a ptr to the node defined by xpath

Parameters
xpathxpath string for the node
nodethe node to search within
Returns
node a xpathobj, which is != 0, but might have 0 elements, i.e. nodesetval == 0 or nodesetval->nodeNr == 0
Exceptions
CDMExceptionif xpath is not parsable
void MetNoFimex::XMLDoc::registerNamespace ( const std::string prefix,
const std::string uri 
)

register a namespace for later xpath

register a namespace with a prefix for later xpath retrievals

Parameters
prefixshort name for namespace
urifull namespace name
std::string MetNoFimex::XMLDoc::toString ( const xmlNodePtr  node)

make a string representation of a node as full xml-document

Parameters
nodea node to print
Returns
string

The documentation for this class was generated from the following file: