6#include <xercesc/util/XercesDefs.hpp>
8XERCES_CPP_NAMESPACE_BEGIN
11class XMLLCPTranscoder;
14XERCES_CPP_NAMESPACE_END
29 class DomException : std::exception {
32 m_name(
"DomException"), m_extra(extraInfo) {}
35 std::string msg =
m_name +
": " + m_extra;
37 virtual const char*
what() {
38 return m_extra.c_str();
46 class NullNode :
public DomException {
53 class WrongAttributeType :
public DomException {
58 m_name =
"WrongAttributeType";
63 class WrongNodeType :
public DomException {
74 using XERCES_CPP_NAMESPACE_QUALIFIER DOMElement;
75 using XERCES_CPP_NAMESPACE_QUALIFIER DOMNode;
76 using XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument;
91 const char*
const name);
93 const std::string name);
105 const std::string&
id);
119 const std::string& tagName);
125 const std::string& tagName,
126 std::vector<DOMElement*>& children,
133 const std::string& tagName,
134 std::vector<DOMElement*>& children,
140 std::map<std::string, DOMNode*>& atts,
151 const char* attName);
156 std::string attName);
162 const char* attName);
167 std::string attName);
180 std::vector<double>& values,
190 std::vector<float>& values,
204 std::vector<int>& values,
210 static std::string
getText(
const DOMNode* textNode);
239 const char *
const value);
281 static char* transToChar(
const XMLCh*
const str);
282 static char* transToChar(
const XMLCh*
const str,
unsigned int len);
287 static XMLCh* transToXMLCh(
const char*
const src);
290 static unsigned int transBufSize;
291 static char* transBuf;
292 static unsigned int xmlchBufSize;
293 static XMLCh* xmlchBuf;
294 static XERCES_CPP_NAMESPACE_QUALIFIER XMLLCPTranscoder* transcoder;
295 static int initTrans();
297 static XMLCh* xmlchStar;
Base exception class for Dom.
DomException(const std::string &extraInfo="")
virtual std::string getMsg()
virtual const char * what()
static std::string getAttribute(const DOMElement *elt, std::string attName)
static std::string getTextContent(const DOMElement *elt)
static DOMElement * getElementById(const DOMDocument *doc, const std::string &id)
static unsigned getDoublesAttribute(const DOMNode *elt, std::string attName, std::vector< double > &values, bool clear=true)
static void addAttribute(DOMElement *elt, std::string name, std::string value)
Add an attribute of type string to a DOM element.
static void printElement(DOMNode *elt, std::ostream &out)
static DOMElement * findFirstChildByName(const DOMElement *parent, const char *const name)
static DOMElement * getSiblingElement(const DOMNode *child)
Return next element sibling, if any.
static std::string getText(const DOMNode *textNode)
static double getDoubleAttribute(const DOMNode *elt, std::string attName)
static void addAttribute(DOMElement *elt, std::string name, double value)
Add attribute of type double to a DOM element, DOMString att name.
static std::string getAttribute(const DOMNode *elt, std::string attName)
static std::string getNodeName(const DOMNode *elt)
static void addAttribute(DOMElement *elt, std::string name, unsigned int value)
Add attribute of type unsigned int to a DOM element.
static std::string getAttribute(const DOMElement *elt, const char *attName)
static unsigned getFloatsAttribute(const DOMNode *elt, std::string attName, std::vector< float > &values, bool clear=true)
static std::string getTagName(const DOMElement *node)
static void getDescendantsByTagName(const DOMElement *parent, const std::string &tagName, std::vector< DOMElement * > &children, bool clear=true)
static void addAttribute(DOMElement *elt, std::string name, int value)
Add attribute of type int to a DOM element.
static void prettyPrintElement(DOMNode *elt, std::ostream &out, std::string prefix)
static int getIntAttribute(const DOMNode *elt, std::string attName)
static DOMElement * findFirstChildByName(const DOMElement *parent, const std::string name)
static unsigned getIntsAttribute(const DOMNode *elt, std::string attName, std::vector< int > &values, bool clear=true)
static void getAttributeNodeMap(const DOMNode *elt, std::map< std::string, DOMNode * > &atts, bool clear=true)
static std::string getAttribute(const DOMNode *elt, const char *attName)
static void addAttribute(DOMElement *elt, std::string name, const char *const value)
Add an attribute of type char* to a DOM element.
static bool checkTagName(const DOMElement *element, const std::string &tagName)
static bool hasAttribute(const DOMNode *elt, const char *attName)
static void getChildrenByTagName(const DOMElement *parent, const std::string &tagName, std::vector< DOMElement * > &children, bool clear=true)
static void prune(DOMElement *elt)
static DOMElement * getFirstChildElement(const DOMNode *parent)
Get first child which is an element node, if any.
NullNode(const std::string &extraInfo="")
WrongAttributeType(const std::string &extraInfo="")
virtual ~WrongAttributeType()
WrongNodeType(const std::string &extraInfo="")