YAZ
5.34.0
|
Implements reading of MARCXML using SAX parsing. More...
#include <stdio.h>
#include <yaz/log.h>
#include <yaz/marc_sax.h>
#include <yaz/wrbuf.h>
#include <yaz/nmem_xml.h>
Go to the source code of this file.
Data Structures | |
struct | yaz_marc_sax_t_ |
Macros | |
#define | MAX_IND 9 |
Functions | |
static int | get_attribute (const char *name, int nb_attributes, const xmlChar **attributes, WRBUF result) |
static void | get_indicators (yaz_marc_sax_t ctx, int nb_attributes, const xmlChar **attributes) |
static void | yaz_start_element_ns (void *vp, 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 | yaz_end_element_ns (void *vp, const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI) |
static void | yaz_characters (void *vp, const xmlChar *text, int len) |
yaz_marc_sax_t | yaz_marc_sax_new (yaz_marc_t mt, void(*cb)(yaz_marc_t, void *), void *cb_data) |
xmlSAXHandlerPtr | yaz_marc_sax_get_handler (yaz_marc_sax_t ctx) |
return Libxml SAX handler pointer More... | |
void | yaz_marc_sax_destroy (yaz_marc_sax_t ctx) |
destroys marc SAX parser More... | |
Implements reading of MARCXML using SAX parsing.
Definition in file marc_read_sax.c.
#define MAX_IND 9 |
Definition at line 20 of file marc_read_sax.c.
|
static |
Definition at line 36 of file marc_read_sax.c.
References name, and wrbuf_putc.
Referenced by get_indicators(), and yaz_start_element_ns().
|
static |
Definition at line 59 of file marc_read_sax.c.
References get_attribute(), yaz_marc_sax_t_::indicator_length, yaz_marc_sax_t_::indicators, wrbuf_putc, and wrbuf_rewind().
Referenced by yaz_start_element_ns().
|
static |
Definition at line 135 of file marc_read_sax.c.
References yaz_marc_sax_t_::cdata, and wrbuf_write().
Referenced by yaz_marc_sax_new().
|
static |
Definition at line 104 of file marc_read_sax.c.
References yaz_marc_sax_t_::cb_data, yaz_marc_sax_t_::cb_func, yaz_marc_sax_t_::cdata, yaz_marc_sax_t_::indicator_length, yaz_marc_sax_t_::mt, yaz_marc_sax_t_::tag, wrbuf_buf, wrbuf_cstr(), wrbuf_len, wrbuf_rewind(), yaz_marc_add_controlfield(), yaz_marc_add_subfield(), and yaz_marc_set_leader().
Referenced by yaz_marc_sax_new().
void yaz_marc_sax_destroy | ( | yaz_marc_sax_t | ctx | ) |
destroys marc SAX parser
ctx |
Definition at line 164 of file marc_read_sax.c.
References yaz_marc_sax_t_::cdata, yaz_marc_sax_t_::indicators, yaz_marc_sax_t_::tag, wrbuf_destroy(), and xfree.
xmlSAXHandlerPtr yaz_marc_sax_get_handler | ( | yaz_marc_sax_t | ctx | ) |
return Libxml SAX handler pointer
Definition at line 159 of file marc_read_sax.c.
References yaz_marc_sax_t_::saxHandler.
yaz_marc_sax_t yaz_marc_sax_new | ( | yaz_marc_t | mt, |
void(*)(yaz_marc_t, void *) | cb, | ||
void * | cb_data | ||
) |
Definition at line 141 of file marc_read_sax.c.
References yaz_marc_sax_t_::cb_data, yaz_marc_sax_t_::cb_func, yaz_marc_sax_t_::cdata, yaz_marc_sax_t_::indicators, yaz_marc_sax_t_::mt, yaz_marc_sax_t_::saxHandler, yaz_marc_sax_t_::tag, wrbuf_alloc(), xmalloc, yaz_characters(), yaz_end_element_ns(), and yaz_start_element_ns().
|
static |
Definition at line 73 of file marc_read_sax.c.
References yaz_marc_sax_t_::cdata, get_attribute(), get_indicators(), yaz_marc_sax_t_::indicators, yaz_marc_sax_t_::mt, yaz_marc_sax_t_::tag, wrbuf_buf, wrbuf_cstr(), wrbuf_len, wrbuf_rewind(), yaz_marc_add_datafield(), and yaz_marc_reset().
Referenced by yaz_marc_sax_new().