1
/* Copyright (C) 2000 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; either version 2 of the License, or
6
(at your option) any later version.
8
This program is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
GNU General Public License for more details.
13
You should have received a copy of the GNU General Public License
14
along with this program; if not, write to the Free Software
15
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
21
namespace mysql_parser
30
#define MY_XML_ERROR 1
33
A flag whether to use absolute tag names in call-back functions,
34
like "a", "a.b" and "a.b.c" (used in character set file parser),
35
or relative names like "a", "b" and "c".
37
#define MY_XML_FLAG_RELATIVE_NAMES 1
40
A flag whether to skip normilization of text values before calling
41
call-back functions: i.e. skip leading/trailing spaces,
42
\r, \n, \t characters.
44
#define MY_XML_FLAG_SKIP_TEXT_NORMALIZATION 2
48
MY_XML_NODE_TAG, /* can have TAG, ATTR and TEXT children */
49
MY_XML_NODE_ATTR, /* can have TEXT children */
50
MY_XML_NODE_TEXT /* cannot have children */
53
typedef struct xml_stack_st
56
enum my_xml_node_type current_node_type;
64
int (*enter)(struct xml_stack_st *st,const char *val, uint len);
65
int (*value)(struct xml_stack_st *st,const char *val, uint len);
66
int (*leave_xml)(struct xml_stack_st *st,const char *val, uint len);
69
void my_xml_parser_create(MY_XML_PARSER *st);
70
void my_xml_parser_free(MY_XML_PARSER *st);
71
int my_xml_parse(MY_XML_PARSER *st,const char *str, uint len);
73
void my_xml_set_value_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *,
76
void my_xml_set_enter_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *,
79
void my_xml_set_leave_handler(MY_XML_PARSER *st, int (*)(MY_XML_PARSER *,
82
void my_xml_set_user_data(MY_XML_PARSER *st, void *);
84
uint my_xml_error_pos(MY_XML_PARSER *st);
85
uint my_xml_error_lineno(MY_XML_PARSER *st);
87
const char *my_xml_error_string(MY_XML_PARSER *st);
93
} // namespace mysql_parser
95
#endif /* _my_xml_h */