26 #ifndef d4_parser_sax2_h
27 #define d4_parser_sax2_h
34 #include <libxml/parserInternals.h>
82 inside_attribute_container,
84 inside_attribute_value,
85 inside_other_xml_attribute,
110 stack<BaseType*> bt_stack;
111 stack<AttrTable*> at_stack;
123 unsigned int other_xml_depth;
124 unsigned int unknown_depth;
128 xmlParserCtxtPtr ctxt;
134 string dods_attr_name;
135 string dods_attr_type;
145 void clone(
const XMLAttribute &src) {
151 XMLAttribute() : prefix(
""), nsURI(
""), value(
"") {}
152 XMLAttribute(
const string &p,
const string &ns,
const string &v)
153 : prefix(p), nsURI(ns), value(v) {}
156 XMLAttribute(
const xmlChar **attributes) {
157 prefix = attributes[0] != 0 ? (
const char *)attributes[0]:
"";
158 nsURI = attributes[1] != 0 ? (
const char *)attributes[1]:
"";
159 value = string((
const char *)attributes[2], (
const char *)attributes[3]);
161 XMLAttribute(
const XMLAttribute &rhs) {
164 XMLAttribute &operator=(
const XMLAttribute &rhs) {
172 typedef map<string, XMLAttribute> XMLAttrMap;
173 XMLAttrMap xml_attrs;
175 XMLAttrMap::iterator xml_attr_begin() {
176 return xml_attrs.begin();
179 XMLAttrMap::iterator xml_attr_end() {
180 return xml_attrs.end();
183 map<string, string> namespace_table;
186 void set_state(D4ParserSax2::ParseState state);
187 D4ParserSax2::ParseState get_state()
const;
194 void cleanup_parse(xmlParserCtxtPtr &context)
const;
202 void transfer_xml_attrs(
const xmlChar **attrs,
int nb_attributes);
203 void transfer_xml_ns(
const xmlChar **namespaces,
int nb_namespaces);
204 bool check_required_attribute(
const string &attr);
205 bool check_attribute(
const string & attr);
207 void process_attribute_helper(
const xmlChar **attrs,
int nb_attrs);
209 void process_variable_helper(
Type t, ParseState s,
const xmlChar **attrs,
int nb_attributes);
211 void process_enum_const_helper(
const xmlChar **attrs,
int nb_attributes);
212 void process_enum_def_helper(
const xmlChar **attrs,
int nb_attributes);
214 void process_dimension(
const xmlChar **attrs,
int nb_attrs);
216 bool process_attribute(
const char *name,
const xmlChar **attrs,
int nb_attributes);
217 bool process_variable(
const char *name,
const xmlChar **attrs,
int nb_attributes);
219 bool process_enum_def(
const char *name,
const xmlChar **attrs,
int nb_attributes);
220 bool process_enum_const(
const char *name,
const xmlChar **attrs,
int nb_attributes);
222 void finish_variable(
const char *tag,
Type t,
const char *expected);
231 other_xml(
""), other_xml_depth(0), unknown_depth(0),
232 error_msg(
""), ctxt(0), dds(0),
233 dods_attr_name(
""), dods_attr_type(
""),
234 char_data(
""), root_ns(
"")
237 void intern(
const string &document,
DDS *dest_dds);
244 const xmlChar *localname,
const xmlChar *prefix,
const xmlChar *URI,
245 int nb_namespaces,
const xmlChar **namespaces,
int nb_attributes,
246 int nb_defaulted,
const xmlChar **attributes);
248 const xmlChar *prefix,
const xmlChar *URI);
252 const xmlChar * ch,
int len);
253 static void ddx_get_cdata(
void *parser,
const xmlChar *value,
int len);
255 static xmlEntityPtr
ddx_get_entity(
void *parser,
const xmlChar *name);
261 #endif // d4_parser_sax2_h
friend class D4ParserSax2Test
static void ddx_get_cdata(void *parser, const xmlChar *value, int len)
static void ddx_ignoreable_whitespace(void *parser, const xmlChar *ch, int len)
Type
Identifies the data type.
static void ddx_start_document(void *parser)
static void ddx_start_element(void *parser, const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI, int nb_namespaces, const xmlChar **namespaces, int nb_attributes, int nb_defaulted, const xmlChar **attributes)
static void ddx_get_characters(void *parser, const xmlChar *ch, int len)
static xmlEntityPtr ddx_get_entity(void *parser, const xmlChar *name)
The basic data type for the DODS DAP types.
static void ddx_fatal_error(void *parser, const char *msg,...)
void intern(const string &document, DDS *dest_dds)
static void ddx_end_document(void *parser)
static void ddx_end_element(void *parser, const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI)