YAZ
5.34.0
|
Implements XML to OPAC conversion. More...
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <yaz/proto.h>
#include <yaz/marcdisp.h>
#include <yaz/wrbuf.h>
#include <yaz/oid_db.h>
#include "sru-p.h"
Go to the source code of this file.
Functions | |
static int | match_element_next (xmlNode **ptr, const char *elem, NMEM nmem, char **val) |
static int | match_v_next (xmlNode **ptr, const char *elem, NMEM nmem, Odr_bool **val) |
static int | bibliographicRecord (yaz_marc_t mt, xmlNode *ptr, Z_External **ext, NMEM nmem, const Odr_oid *syntax) |
static int | volume (xmlNode *ptr, Z_Volume **volp, NMEM nmem) |
static int | volumes (xmlNode *ptr, Z_Volume ***volp, int *num, NMEM nmem) |
static int | circulation (xmlNode *ptr, Z_CircRecord **circp, NMEM nmem) |
static int | circulations (xmlNode *ptr, Z_CircRecord ***circp, int *num, NMEM nmem) |
static int | holdingsRecord (xmlNode *ptr, Z_HoldingsRecord **r, NMEM nmem) |
static int | yaz_xml_to_opac_ptr (yaz_marc_t mt, xmlNode *ptr, Z_OPACRecord **dst, NMEM nmem, const Odr_oid *syntax) |
int | yaz_xml_to_opac (yaz_marc_t mt, const char *buf_in, size_t size_in, Z_OPACRecord **dst, yaz_iconv_t cd, NMEM nmem, const Odr_oid *syntax) |
Converts XML to OPAC. More... | |
Implements XML to OPAC conversion.
Definition in file xml_to_opac.c.
|
static |
Definition at line 70 of file xml_to_opac.c.
References wrbuf_alloc(), wrbuf_buf, wrbuf_destroy(), wrbuf_len, yaz_marc_read_xml(), yaz_marc_write_iso2709(), yaz_oid_recsyn_usmarc, and z_ext_record_oid_nmem().
Referenced by yaz_xml_to_opac_ptr().
|
static |
Definition at line 131 of file xml_to_opac.c.
References match_element_next(), match_v_next(), and nmem_malloc().
Referenced by circulations().
|
static |
Definition at line 151 of file xml_to_opac.c.
References circulation(), nmem_malloc(), and yaz_match_xsd_element().
Referenced by holdingsRecord().
|
static |
Definition at line 184 of file xml_to_opac.c.
References Z_HoldingsAndCircData::callNumber, Z_HoldingsAndCircData::circulationData, circulations(), Z_HoldingsAndCircData::completeness, Z_HoldingsAndCircData::copyNumber, Z_HoldingsAndCircData::dateOfReport, Z_HoldingsAndCircData::encodingLevel, Z_HoldingsAndCircData::enumAndChron, Z_HoldingsAndCircData::format, Z_HoldingsAndCircData::generalRetention, Z_HoldingsAndCircData::localLocation, match_element_next(), nmem_malloc(), Z_HoldingsAndCircData::nucCode, Z_HoldingsAndCircData::num_circulationData, Z_HoldingsAndCircData::num_volumes, Z_HoldingsAndCircData::publicNote, Z_HoldingsAndCircData::receiptAcqStatus, Z_HoldingsAndCircData::reproductionNote, Z_HoldingsAndCircData::shelvingData, Z_HoldingsAndCircData::shelvingLocation, Z_HoldingsAndCircData::termsUseRepro, Z_HoldingsAndCircData::typeOfRecord, volumes(), Z_HoldingsAndCircData::volumes, yaz_match_xsd_element(), and Z_HoldingsRecord_holdingsAndCirc.
Referenced by yaz_xml_to_opac_ptr().
|
static |
Definition at line 25 of file xml_to_opac.c.
References yaz_match_xsd_string_n_nmem().
Referenced by circulation(), holdingsRecord(), and volume().
Definition at line 39 of file xml_to_opac.c.
References nmem_booldup(), and yaz_match_xsd_element().
Referenced by circulation().
Definition at line 89 of file xml_to_opac.c.
References match_element_next(), and nmem_malloc().
Referenced by volumes().
Definition at line 99 of file xml_to_opac.c.
References nmem_malloc(), volume(), and yaz_match_xsd_element().
Referenced by holdingsRecord().
int yaz_xml_to_opac | ( | yaz_marc_t | mt, |
const char * | buf_in, | ||
size_t | size_in, | ||
Z_OPACRecord ** | dst, | ||
yaz_iconv_t | cd, | ||
NMEM | nmem, | ||
const Odr_oid * | syntax | ||
) |
Converts XML to OPAC.
mt | marc handle |
buf_in | XML buffer |
size_in | size of XML buffer |
dst | Z39.50 OPAC result - allocated by NMEM on marc handle |
cd | iconv handle for the OPAC content (not ISO2709 part) |
nmem | memory for OPACRecord (if NULL, mt NMEM memory is used) |
syntax | OID for embedded MARC (if NULL, USMARC is used) |
1 | conversion OK |
0 | conversion NOT OK \ |
Definition at line 299 of file xml_to_opac.c.
References yaz_marc_iconv(), and yaz_xml_to_opac_ptr().
Referenced by retrieve_fetch().
|
static |
Definition at line 235 of file xml_to_opac.c.
References bibliographicRecord(), Z_OPACRecord::bibliographicRecord, Z_OPACRecord::holdingsData, holdingsRecord(), nmem_malloc(), Z_OPACRecord::num_holdingsData, yaz_marc_get_nmem(), and yaz_match_xsd_element().
Referenced by yaz_xml_to_opac().