YAZ  5.34.0
Functions
xmlquery.c File Reference

Query / XML conversions. More...

#include <stdio.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>

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()

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

Definition at line 349 of file xmlquery.c.

References odr_booldup().

Referenced by yaz_xml2query_operator().

◆ check_diagnostic()

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

Definition at line 26 of file xmlquery.c.

References odr_strdup().

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

◆ intVal()

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

Definition at line 356 of file xmlquery.c.

References odr_intdup().

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

◆ strVal()

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

Definition at line 537 of file xmlquery.c.

References nmem_text_node_cdata(), and odr_getmem.

Referenced by yaz_xml2query_rset(), and yaz_xml2query_term().

◆ yaz_query2xml()

void yaz_query2xml ( const Z_Query q,
xmlDocPtr *  docp 
)

◆ yaz_query2xml_apt()

static xmlNodePtr yaz_query2xml_apt ( const Z_AttributesPlusTerm zapt,
xmlNodePtr  parent 
)
static

◆ yaz_query2xml_attribute_element()

static void yaz_query2xml_attribute_element ( const Z_AttributeElement element,
xmlNodePtr  parent 
)
static

◆ yaz_query2xml_ccl()

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

Definition at line 282 of file xmlquery.c.

Referenced by yaz_query2xml().

◆ yaz_query2xml_cql()

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

Definition at line 292 of file xmlquery.c.

Referenced by yaz_query2xml().

◆ yaz_query2xml_operator()

static void yaz_query2xml_operator ( Z_Operator op,
xmlNodePtr  node 
)
static

◆ yaz_query2xml_rpn()

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

◆ yaz_query2xml_rpnstructure()

static xmlNodePtr yaz_query2xml_rpnstructure ( const Z_RPNStructure zs,
xmlNodePtr  parent 
)
static

◆ yaz_query2xml_term()

static xmlNodePtr yaz_query2xml_term ( const Z_Term term,
xmlNodePtr  parent 
)
static

◆ yaz_query2xml_z3958()

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

Definition at line 287 of file xmlquery.c.

Referenced by yaz_query2xml().

◆ yaz_rpnquery2xml()

void yaz_rpnquery2xml ( const Z_RPNQuery rpn,
xmlDocPtr *  docp 
)

Definition at line 297 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 821 of file xmlquery.c.

References yaz_xml2query_().

◆ yaz_xml2query_()

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

Definition at line 766 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()

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

◆ yaz_xml2query_attribute_element()

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

◆ yaz_xml2query_operator()

static void yaz_xml2query_operator ( const xmlNode *  ptr,
Z_Operator **  op,
ODR  odr,
int *  error_code,
const char **  addinfo 
)
static

◆ yaz_xml2query_rpn()

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

◆ yaz_xml2query_rpnstructure()

static void yaz_xml2query_rpnstructure ( const xmlNode *  ptr,
Z_RPNStructure **  zs,
ODR  odr,
int *  error_code,
const char **  addinfo 
)
static

◆ yaz_xml2query_rset()

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

Definition at line 673 of file xmlquery.c.

References strVal().

Referenced by yaz_xml2query_rpnstructure().

◆ yaz_xml2query_term()

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