6#include <xercesc/util/XercesDefs.hpp>
8XERCES_CPP_NAMESPACE_BEGIN
11class XMLLCPTranscoder;
14XERCES_CPP_NAMESPACE_END
32 :
std::exception(),
m_name(
"DomException" ), m_extra( extraInfo ) {}
35 std::string msg =
m_name +
": " + m_extra;
38 virtual const char*
what() {
return m_extra.c_str(); }
58 m_name =
"WrongAttributeType";
72 using XERCES_CPP_NAMESPACE_QUALIFIER DOMElement;
73 using XERCES_CPP_NAMESPACE_QUALIFIER DOMNode;
74 using XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument;
89 const char*
const name );
91 const std::string name );
102 static DOMElement*
getElementById(
const DOMDocument* doc,
const std::string&
id );
106 static std::string
getNodeName(
const DOMNode* elt );
110 static std::string
getTagName(
const DOMElement* node );
114 static bool checkTagName(
const DOMElement* element,
const std::string& tagName );
120 std::vector<DOMElement*>& children,
bool clear =
true );
126 std::vector<DOMElement*>& children,
131 static void getAttributeNodeMap(
const DOMNode* elt, std::map<std::string, DOMNode*>& atts,
136 static bool hasAttribute(
const DOMNode* elt,
const char* attName );
141 static std::string
getAttribute(
const DOMElement* elt,
const char* attName );
145 static std::string
getAttribute(
const DOMElement* elt, std::string attName );
150 static std::string
getAttribute(
const DOMNode* elt,
const char* attName );
154 static std::string
getAttribute(
const DOMNode* elt, std::string attName );
166 std::vector<double>& values,
bool clear =
true );
174 std::vector<float>& values,
bool clear =
true );
186 std::vector<int>& values,
bool clear =
true );
191 static std::string
getText(
const DOMNode* textNode );
203 static void addAttribute( DOMElement* elt, std::string name,
double value );
206 static void addAttribute( DOMElement* elt, std::string name,
int value );
209 static void addAttribute( DOMElement* elt, std::string name,
unsigned int value );
212 static void addAttribute( DOMElement* elt, std::string name, std::string value );
215 static void addAttribute( DOMElement* elt, std::string name,
const char*
const value );
226 static void printElement( DOMNode* elt, std::ostream& out );
236 static void prettyPrintElement( DOMNode* elt, std::ostream& out, std::string prefix );
240 static void prune( DOMElement* elt );
254 static char* transToChar(
const XMLCh*
const str );
255 static char* transToChar(
const XMLCh*
const str,
unsigned int len );
259 static XMLCh* transToXMLCh(
const char*
const src );
261 static unsigned int transBufSize;
262 static char* transBuf;
263 static unsigned int xmlchBufSize;
264 static XMLCh* xmlchBuf;
265 static XERCES_CPP_NAMESPACE_QUALIFIER XMLLCPTranscoder* transcoder;
266 static int initTrans();
268 static XMLCh* xmlchStar;
DomException(const std::string &extraInfo="")
virtual std::string getMsg()
virtual const char * what()
static std::string getTagName(const DOMElement *node)
static void getChildrenByTagName(const DOMElement *parent, const std::string &tagName, std::vector< DOMElement * > &children, bool clear=true)
static void addAttribute(DOMElement *elt, std::string name, double value)
Add attribute of type double to a DOM element, DOMString att name.
static int getIntAttribute(const DOMNode *elt, std::string attName)
static DOMElement * getSiblingElement(const DOMNode *child)
Return next element sibling, if any.
static unsigned getFloatsAttribute(const DOMNode *elt, std::string attName, std::vector< float > &values, bool clear=true)
static std::string getTextContent(const DOMElement *elt)
static void prettyPrintElement(DOMNode *elt, std::ostream &out, std::string prefix)
static void getAttributeNodeMap(const DOMNode *elt, std::map< std::string, DOMNode * > &atts, bool clear=true)
static void printElement(DOMNode *elt, std::ostream &out)
static bool hasAttribute(const DOMNode *elt, const char *attName)
static double getDoubleAttribute(const DOMNode *elt, std::string attName)
static DOMElement * getElementById(const DOMDocument *doc, const std::string &id)
static std::string getNodeName(const DOMNode *elt)
static std::string getAttribute(const DOMElement *elt, const char *attName)
static DOMElement * findFirstChildByName(const DOMElement *parent, const char *const name)
static void getDescendantsByTagName(const DOMElement *parent, const std::string &tagName, std::vector< DOMElement * > &children, bool clear=true)
static unsigned getDoublesAttribute(const DOMNode *elt, std::string attName, std::vector< double > &values, bool clear=true)
static DOMElement * getFirstChildElement(const DOMNode *parent)
Get first child which is an element node, if any.
static unsigned getIntsAttribute(const DOMNode *elt, std::string attName, std::vector< int > &values, bool clear=true)
static void prune(DOMElement *elt)
static std::string getText(const DOMNode *textNode)
static bool checkTagName(const DOMElement *element, const std::string &tagName)
NullNode(const std::string &extraInfo="")
WrongAttributeType(const std::string &extraInfo="")
virtual ~WrongAttributeType()
WrongNodeType(const std::string &extraInfo="")