YAZ 5.37.0
xmlquery.c File Reference

Query / XML conversions. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <yaz/logrpn.h>
#include <yaz/xmlquery.h>
#include <yaz/nmem_xml.h>
#include <yaz/xml_get.h>
#include <yaz/oid_db.h>
#include <yaz/snprintf.h>

Go to the source code of this file.

Functions

static int check_diagnostic (const xmlNode *ptr, ODR odr, int *error_code, const char **addinfo)
static void yaz_query2xml_attribute_element (const Z_AttributeElement *element, xmlNodePtr parent)
static xmlNodePtr yaz_query2xml_term (const Z_Term *term, xmlNodePtr parent)
static xmlNodePtr yaz_query2xml_apt (const Z_AttributesPlusTerm *zapt, xmlNodePtr parent)
static void yaz_query2xml_operator (Z_Operator *op, xmlNodePtr node)
static xmlNodePtr yaz_query2xml_rpnstructure (const Z_RPNStructure *zs, xmlNodePtr parent)
static xmlNodePtr yaz_query2xml_rpn (const Z_RPNQuery *rpn, xmlNodePtr parent)
static xmlNodePtr yaz_query2xml_ccl (const Odr_oct *ccl, xmlNodePtr node)
static xmlNodePtr yaz_query2xml_z3958 (const Odr_oct *ccl, xmlNodePtr node)
static xmlNodePtr yaz_query2xml_cql (const char *cql, xmlNodePtr node)
void yaz_rpnquery2xml (const Z_RPNQuery *rpn, xmlDocPtr *docp)
void yaz_query2xml (const Z_Query *q, xmlDocPtr *docp)
static bool_tboolVal (ODR odr, const char *str)
static Odr_intintVal (ODR odr, const char *str)
static void yaz_xml2query_operator (const xmlNode *ptr, Z_Operator **op, ODR odr, int *error_code, const char **addinfo)
static void yaz_xml2query_attribute_element (const xmlNode *ptr, Z_AttributeElement **elem, ODR odr, int *error_code, const char **addinfo)
static char * strVal (const xmlNode *ptr_cdata, ODR odr)
static void yaz_xml2query_term (const xmlNode *ptr, Z_Term **term, ODR odr, int *error_code, const char **addinfo)
static void yaz_xml2query_apt (const xmlNode *ptr_apt, Z_AttributesPlusTerm **zapt, ODR odr, int *error_code, const char **addinfo)
static void yaz_xml2query_rset (const xmlNode *ptr, Z_ResultSetId **rset, ODR odr, int *error_code, const char **addinfo)
static void yaz_xml2query_rpnstructure (const xmlNode *ptr, Z_RPNStructure **zs, ODR odr, int *error_code, const char **addinfo)
static void yaz_xml2query_rpn (const xmlNode *ptr, Z_RPNQuery **query, ODR odr, int *error_code, const char **addinfo)
static void yaz_xml2query_ (const xmlNode *ptr, Z_Query **query, ODR odr, int *error_code, const char **addinfo)
void yaz_xml2query (const xmlNode *xmlnodep, Z_Query **query, ODR odr, int *error_code, const char **addinfo)

Detailed Description

Query / XML conversions.

Definition in file xmlquery.c.

Function Documentation

◆ boolVal()

bool_t * boolVal ( ODR odr,
const char * str )
static

Definition at line 351 of file xmlquery.c.

References bool_t, and odr_booldup().

Referenced by yaz_xml2query_operator().

◆ check_diagnostic()

int check_diagnostic ( const xmlNode * ptr,
ODR odr,
int * error_code,
const char ** addinfo )
static

Definition at line 28 of file xmlquery.c.

References odr_strdup().

Referenced by yaz_xml2query_(), yaz_xml2query_apt(), and yaz_xml2query_rpnstructure().

◆ intVal()

Odr_int * intVal ( ODR odr,
const char * str )
static

Definition at line 358 of file xmlquery.c.

References odr_intdup().

Referenced by yaz_xml2query_attribute_element(), yaz_xml2query_operator(), and yaz_xml2query_term().

◆ strVal()

char * strVal ( const xmlNode * ptr_cdata,
ODR odr )
static

Definition at line 539 of file xmlquery.c.

References nmem_text_node_cdata(), and odr_getmem.

Referenced by yaz_xml2query_rset(), and yaz_xml2query_term().

◆ yaz_query2xml()

◆ yaz_query2xml_apt()

◆ yaz_query2xml_attribute_element()

◆ yaz_query2xml_ccl()

xmlNodePtr yaz_query2xml_ccl ( const Odr_oct * ccl,
xmlNodePtr node )
static

Definition at line 284 of file xmlquery.c.

Referenced by yaz_query2xml().

◆ yaz_query2xml_cql()

xmlNodePtr yaz_query2xml_cql ( const char * cql,
xmlNodePtr node )
static

Definition at line 294 of file xmlquery.c.

Referenced by yaz_query2xml().

◆ yaz_query2xml_operator()

◆ yaz_query2xml_rpn()

xmlNodePtr yaz_query2xml_rpn ( const Z_RPNQuery * rpn,
xmlNodePtr parent )
static

◆ yaz_query2xml_rpnstructure()

◆ yaz_query2xml_term()

◆ yaz_query2xml_z3958()

xmlNodePtr yaz_query2xml_z3958 ( const Odr_oct * ccl,
xmlNodePtr node )
static

Definition at line 289 of file xmlquery.c.

Referenced by yaz_query2xml().

◆ yaz_rpnquery2xml()

void yaz_rpnquery2xml ( const Z_RPNQuery * rpn,
xmlDocPtr * docp )

Definition at line 299 of file xmlquery.c.

References Z_Query::type_1, Z_Query::u, Z_Query::which, yaz_query2xml(), and Z_Query_type_1.

◆ yaz_xml2query()

void yaz_xml2query ( const xmlNode * xmlnodep,
Z_Query ** query,
ODR odr,
int * error_code,
const char ** addinfo )

Definition at line 823 of file xmlquery.c.

References yaz_xml2query_().

◆ yaz_xml2query_()

void yaz_xml2query_ ( const xmlNode * ptr,
Z_Query ** query,
ODR odr,
int * error_code,
const char ** addinfo )
static

Definition at line 768 of file xmlquery.c.

References check_diagnostic(), odr_malloc(), type, yaz_xml2query_rpn(), and Z_Query_type_1.

Referenced by yaz_xml2query().

◆ yaz_xml2query_apt()

void yaz_xml2query_apt ( const xmlNode * ptr_apt,
Z_AttributesPlusTerm ** zapt,
ODR odr,
int * error_code,
const char ** addinfo )
static

◆ yaz_xml2query_attribute_element()

void yaz_xml2query_attribute_element ( const xmlNode * ptr,
Z_AttributeElement ** elem,
ODR odr,
int * error_code,
const char ** addinfo )
static

◆ yaz_xml2query_operator()

◆ yaz_xml2query_rpn()

void yaz_xml2query_rpn ( const xmlNode * ptr,
Z_RPNQuery ** query,
ODR odr,
int * error_code,
const char ** addinfo )
static

◆ yaz_xml2query_rpnstructure()

◆ yaz_xml2query_rset()

void yaz_xml2query_rset ( const xmlNode * ptr,
Z_ResultSetId ** rset,
ODR odr,
int * error_code,
const char ** addinfo )
static

Definition at line 675 of file xmlquery.c.

References strVal().

Referenced by yaz_xml2query_rpnstructure().

◆ yaz_xml2query_term()

void yaz_xml2query_term ( const xmlNode * ptr,
Z_Term ** term,
ODR odr,
int * error_code,
const char ** addinfo )
static