20 #ifndef _PARSERBASE_HXX_
21 #define _PARSERBASE_HXX_
30 #include <libxml/parser.h>
31 #include <libxml/tree.h>
32 #include <libxml/xmlreader.h>
44 parser():_level(0),_defaultParsersMap(0)
46 _counts=
new std::map<std::string,int>;
49 virtual void SetUserDataAndPush(
parser* pp);
52 virtual void charData(
const XML_Char *s,
int len);
53 virtual void endParser();
55 virtual void incrCount(
const XML_Char *elem);
56 virtual void checkOrder(std::string& el);
57 virtual void maxcount(std::string name,
int max, std::string& el);
58 virtual void mincount(std::string name,
int min );
59 virtual void maxchoice(std::string *names,
int max, std::string& el);
60 virtual void minchoice(std::string *names,
int min);
61 virtual void pre(){_content=
"";};
62 virtual void required(
const std::string& name,
const XML_Char** attr);
63 virtual void buildAttr(
const XML_Char** attr);
65 static void XMLCALL start_document(
void* data);
66 static void XMLCALL end_document (
void* data);
67 static void XMLCALL start_element (
void* data,
70 static void XMLCALL end_element (
void* data,
72 static void XMLCALL characters (
void* data,
75 static void XMLCALL comment (
void* data,
76 const xmlChar* value);
77 static void XMLCALL cdata_block (
void* data,
80 static void XMLCALL warning (
void* data,
81 const char* fmt, ...);
82 static void XMLCALL error (
void* data,
83 const char* fmt, ...);
84 static void XMLCALL fatal_error (
void* data,
85 const char* fmt, ...);
87 static void XML_SetUserData(_xmlParserCtxt* ctxt,
parser* par);
89 std::stack<parser*>& getStack();
94 void logError(
const std::string& reason);