#include <DmrppParserSax2.h>
|
bool | get_strict () const |
| Get the setting of the 'strict' mode. More...
|
|
void | intern (std::istream &f, libdap::DMR *dest_dmr, bool debug=false) |
|
void | intern (const string &document, libdap::DMR *dest_dmr, bool debug=false) |
|
void | intern (const char *buffer, int size, libdap::DMR *dest_dmr, bool debug=false) |
|
void | set_strict (bool s) |
| Set the 'strict' mode to true or false. More...
|
|
|
|
These methods are declared static in the class header. This gives them C linkage which allows them to be used as callbacks by the SAX parser engine.
|
static void | dmr_start_document (void *parser) |
|
static void | dmr_end_document (void *parser) |
|
static void | dmr_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 | dmr_end_element (void *parser, const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI) |
|
static void | dmr_get_characters (void *parser, const xmlChar *ch, int len) |
|
static void | dmr_ignoreable_whitespace (void *parser, const xmlChar *ch, int len) |
|
static void | dmr_get_cdata (void *parser, const xmlChar *value, int len) |
|
static xmlEntityPtr | dmr_get_entity (void *parser, const xmlChar *name) |
|
static void | dmr_fatal_error (void *parser, const char *msg,...) |
|
static void | dmr_error (void *parser, const char *msg,...) |
|
|
class | DmrppParserSax2Test |
|
Hacked DMR parser copied from libdap. This version of the parser processes dmrpp:chunk elements and stores their information (xml attributes) in Dmrpp BaseTypes.
Definition at line 62 of file DmrppParserSax2.h.
◆ dmr_end_document()
void dmrpp::DmrppParserSax2::dmr_end_document |
( |
void * |
p | ) |
|
|
static |
◆ dmr_fatal_error()
void dmrpp::DmrppParserSax2::dmr_fatal_error |
( |
void * |
p, |
|
|
const char * |
msg, |
|
|
|
... |
|
) |
| |
|
static |
Process an XML fatal error. Note that SAX provides for warnings, errors and fatal errors. This code treats them all as fatal errors since there's typically no way to tell a user about the error since there's often no user interface for this software.
- Note
- This static function does not throw an exception or otherwise alter flow of control except for altering the parser state.
- Parameters
-
p | The SAX parser |
msg | A printf-style format string. |
Definition at line 1434 of file DmrppParserSax2.cc.
◆ dmr_get_cdata()
void dmrpp::DmrppParserSax2::dmr_get_cdata |
( |
void * |
p, |
|
|
const xmlChar * |
value, |
|
|
int |
len |
|
) |
| |
|
static |
Get characters in a cdata block. DAP does not use CData, but XML in an OtherXML attribute (the value of that DAP attribute) might use it. This callback also allows CData when the parser is in the 'parser_unknown' state since some future DAP element might use it.
Definition at line 1396 of file DmrppParserSax2.cc.
◆ dmr_get_characters()
void dmrpp::DmrppParserSax2::dmr_get_characters |
( |
void * |
p, |
|
|
const xmlChar * |
ch, |
|
|
int |
len |
|
) |
| |
|
static |
Process/accumulate character data. This may be called more than once for one logical clump of data. Only save character data when processing 'value' elements; throw away all other characters.
Definition at line 1352 of file DmrppParserSax2.cc.
◆ dmr_get_entity()
xmlEntityPtr dmrpp::DmrppParserSax2::dmr_get_entity |
( |
void * |
parser, |
|
|
const xmlChar * |
name |
|
) |
| |
|
static |
Handle the standard XML entities.
- Parameters
-
parser | The SAX parser |
name | The XML entity. |
Definition at line 1419 of file DmrppParserSax2.cc.
◆ dmr_ignoreable_whitespace()
void dmrpp::DmrppParserSax2::dmr_ignoreable_whitespace |
( |
void * |
p, |
|
|
const xmlChar * |
ch, |
|
|
int |
len |
|
) |
| |
|
static |
Read whitespace that's not really important for content. This is used only for the OtherXML attribute type to preserve formating of the XML. Doing so makes the attribute value far easier to read.
Definition at line 1377 of file DmrppParserSax2.cc.
◆ dmr_start_document()
void dmrpp::DmrppParserSax2::dmr_start_document |
( |
void * |
p | ) |
|
|
static |
Initialize the SAX parser state object. This object is passed to each callback as a void pointer. The initial state is parser_start.
- Parameters
-
Definition at line 674 of file DmrppParserSax2.cc.
◆ intern() [1/2]
void dmrpp::DmrppParserSax2::intern |
( |
std::istream & |
f, |
|
|
libdap::DMR * |
dest_dmr, |
|
|
bool |
debug = false |
|
) |
| |
Read the DMR from a stream.
- Parameters
-
f | The input stream |
dest_dmr | Value-result parameter. Pass a pointer to a DMR in and the information in the DMR will be added to it. |
boundary | If not empty, use this as the boundary tag in a MPM document that marks the end of the part hat holds the DMR. Stop reading when the boundary is found. |
debug | If true, ouput helpful debugging messages, False by default. |
- Exceptions
-
Error | Thrown if the XML document could not be read or parsed. |
InternalErr | Thrown if an internal error is found. |
Definition at line 1519 of file DmrppParserSax2.cc.
◆ intern() [2/2]
void dmrpp::DmrppParserSax2::intern |
( |
const char * |
buffer, |
|
|
int |
size, |
|
|
libdap::DMR * |
dest_dmr, |
|
|
bool |
debug = false |
|
) |
| |
Parse a DMR document stored in a char *buffer.
- Parameters
-
document | Read the DMR from this string. |
dest_dmr | Value/result parameter; dumps the information to this DMR instance. |
debug | If true, output helpful debugging messages, False by default |
- Exceptions
-
Error | Thrown if the XML document could not be read or parsed. |
InternalErr | Thrown if an internal error is found. |
Definition at line 1630 of file DmrppParserSax2.cc.
The documentation for this class was generated from the following files: