te::xerces Namespace Reference

Namespace for TerraLib Xerces module. More...

Classes

class  ErrorHandler
 This class implements Xerces interface for error handlers. More...
 
class  Globals
 A singleton class with global definitions. More...
 
class  Module
 The TerraLib Xerces module is a plugin. More...
 
class  Reader
 A class that models a XML reader object built on top of Xerces-C++. More...
 
class  ReaderFactory
 This is the concrete factory for XML reader built on top of Xerces-C++ parser. More...
 
class  ReaderHandler
 This class implements Xerces interface for a handler that receives general document events. More...
 
class  StrToXMLCh
 A class for converting a standard string to a Xerces string (XMLCh). More...
 
class  Writer
 
class  WriterFactory
 This is the concrete factory for XML writer built on top of Xerces-C++ parser. More...
 
class  XMLChToStr
 A class for converting a Xerces string (XMLCh) to a standard string. More...
 

Functions

bool Equals (const XMLCh *const s1, const char *const s2)
 It return true if the two strings are identical, otherwise, it returns false. More...
 
char * GetAttributeVal (const xercesc::Attributes &attrs, const XMLCh *const attName)
 It returns the given attribute value. More...
 
bool NotEquals (const XMLCh *const s1, const char *const s2)
 It return true if the two strings are different, otherwise, it returns false. More...
 
TEXERCESEXPORT xercesc::DOMDocument * readXML (const std::string &xmlFile, const bool doNamespace=false, const bool doSchema=false, const bool valid=false)
 It reads the XML file using the DOM API. More...
 
int ToInt (const XMLCh *value)
 It converts the XML string to an integer value. More...
 
std::string ToString (const XMLCh *const value)
 It converts the XML string to a standard C++ string. More...
 

Detailed Description

Namespace for TerraLib Xerces module.

This is the namespace for the TerraLib XML support built on top of Xerces-C++.

Function Documentation

bool te::xerces::Equals ( const XMLCh *const  s1,
const char *const  s2 
)
inline

It return true if the two strings are identical, otherwise, it returns false.

Parameters
s1The first string to compare.
s2The second string to compare.
Returns
True if the two strings are identical, otherwise, it returns false.
Note
This function is intend to be inlined and just convert the XMLCh string to a char* and then compare the two strings.

Definition at line 55 of file Utils.h.

char* te::xerces::GetAttributeVal ( const xercesc::Attributes &  attrs,
const XMLCh *const  attName 
)
inline

It returns the given attribute value.

Parameters
attrsThe attributes attached to an element, if any.
attNameThe name of the attribute we are looking for its value.
Returns
The attribute value or NULL if it is not found.
Note
The caller will take the ownership of the returned pointer. Use xercesc::XMLString::release(&val) in order to release the returned value.

Definition at line 143 of file Utils.h.

bool te::xerces::NotEquals ( const XMLCh *const  s1,
const char *const  s2 
)
inline

It return true if the two strings are different, otherwise, it returns false.

Parameters
s1The first string to compare.
s2The second string to compare.
Returns
True if the two strings are different, otherwise, it returns false.
Note
This function is intend to be inlined and just convert the XMLCh string to a char* and then compare the two strings.

Definition at line 82 of file Utils.h.

TEXERCESEXPORT xercesc::DOMDocument* te::xerces::readXML ( const std::string &  xmlFile,
const bool  doNamespace = false,
const bool  doSchema = false,
const bool  valid = false 
)

It reads the XML file using the DOM API.

Parameters
xmlFileThe XML file to be read.
doNamespaceIf true the namespace processing will be done.
doSchemaIf true the parser will attempt to use the XML schema.
validIf true the parser will valid the XML file against the schema.
Returns
The read dcument.
Exceptions
ExceptionIf the parser can not read the file it will raise an exception.
int te::xerces::ToInt ( const XMLCh *  value)
inline

It converts the XML string to an integer value.

Parameters
valueAn XML string containing a valid int value.
Returns
An int value.

Definition at line 105 of file Utils.h.

std::string te::xerces::ToString ( const XMLCh *const  value)
inline

It converts the XML string to a standard C++ string.

Parameters
valueAn XML string containing a valid string value.
Returns
An int value.
Note
If the pointer is NULL this method will return an empty string.

Definition at line 122 of file Utils.h.