YAZ
5.34.0
|
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_t * | boolVal (ODR odr, const char *str) |
static Odr_int * | intVal (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) |
Query / XML conversions.
Definition in file xmlquery.c.
Definition at line 349 of file xmlquery.c.
References odr_booldup().
Referenced by yaz_xml2query_operator().
|
static |
Definition at line 26 of file xmlquery.c.
References odr_strdup().
Referenced by yaz_xml2query_(), yaz_xml2query_apt(), and yaz_xml2query_rpnstructure().
Definition at line 356 of file xmlquery.c.
References odr_intdup().
Referenced by yaz_xml2query_attribute_element(), yaz_xml2query_operator(), and yaz_xml2query_term().
|
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().
void yaz_query2xml | ( | const Z_Query * | q, |
xmlDocPtr * | docp | ||
) |
Definition at line 306 of file xmlquery.c.
References Z_External::cql, Z_Query::type_1, Z_Query::type_100, Z_Query::type_104, Z_Query::type_2, Z_External::u, Z_Query::u, Z_External::which, Z_Query::which, yaz_query2xml_ccl(), yaz_query2xml_cql(), yaz_query2xml_rpn(), yaz_query2xml_z3958(), Z_External_CQL, Z_Query_type_1, Z_Query_type_100, Z_Query_type_101, Z_Query_type_104, and Z_Query_type_2.
Referenced by yaz_rpnquery2xml().
|
static |
Definition at line 169 of file xmlquery.c.
References Z_AttributesPlusTerm::attributes, Z_AttributeList::attributes, node(), Z_AttributeList::num_attributes, Z_AttributesPlusTerm::term, yaz_query2xml_attribute_element(), and yaz_query2xml_term().
Referenced by yaz_query2xml_rpnstructure().
|
static |
Definition at line 65 of file xmlquery.c.
References Z_AttributeElement::attributeSet, Z_AttributeElement::attributeType, Z_AttributeElement::complex, Z_ComplexAttribute::list, node(), Z_ComplexAttribute::num_list, Z_AttributeElement::numeric, Z_StringOrNumeric::numeric, ODR_INT_PRINTF, OID_STR_MAX, Z_StringOrNumeric::string, Z_StringOrNumeric::u, Z_AttributeElement::value, Z_AttributeElement::which, Z_StringOrNumeric::which, yaz_oid_to_string_buf(), Z_AttributeValue_complex, Z_AttributeValue_numeric, Z_StringOrNumeric_numeric, and Z_StringOrNumeric_string.
Referenced by yaz_query2xml_apt().
|
static |
Definition at line 282 of file xmlquery.c.
Referenced by yaz_query2xml().
|
static |
Definition at line 292 of file xmlquery.c.
Referenced by yaz_query2xml().
|
static |
Definition at line 183 of file xmlquery.c.
References Z_ProximityOperator::distance, Z_ProximityOperator::exclusion, Z_ProximityOperator::known, node(), ODR_INT_PRINTF, Z_ProximityOperator::ordered, Z_Operator::prox, Z_ProximityOperator::relationType, type, Z_Operator::u, Z_ProximityOperator::u, Z_Operator::which, Z_ProximityOperator::which, Z_Operator_and, Z_Operator_and_not, Z_Operator_or, Z_Operator_prox, Z_ProximityOperator_known, and Z_ProximityOperator_private.
Referenced by yaz_query2xml_rpnstructure().
|
static |
Definition at line 269 of file xmlquery.c.
References Z_RPNQuery::attributeSetId, OID_STR_MAX, Z_RPNQuery::RPNStructure, yaz_oid_to_string_buf(), and yaz_query2xml_rpnstructure().
Referenced by yaz_query2xml().
|
static |
Definition at line 243 of file xmlquery.c.
References Z_Operand::attributesPlusTerm, Z_RPNStructure::complex, node(), Z_Operand::resultSetId, Z_Complex::roperator, Z_Complex::s1, Z_Complex::s2, Z_RPNStructure::simple, Z_RPNStructure::u, Z_Operand::u, Z_RPNStructure::which, Z_Operand::which, yaz_query2xml_apt(), yaz_query2xml_operator(), Z_Operand_APT, Z_Operand_resultSetId, Z_RPNStructure_complex, and Z_RPNStructure_simple.
Referenced by yaz_query2xml_rpn().
|
static |
Definition at line 122 of file xmlquery.c.
References odr_oct::buf, Z_Term::characterString, Z_Term::general, odr_oct::len, node(), Z_Term::numeric, ODR_INT_PRINTF, type, Z_Term::u, Z_Term::which, Z_Term_characterString, Z_Term_dateTime, Z_Term_external, Z_Term_general, Z_Term_integerAndUnit, Z_Term_null, Z_Term_numeric, and Z_Term_oid.
Referenced by yaz_query2xml_apt().
|
static |
Definition at line 287 of file xmlquery.c.
Referenced by yaz_query2xml().
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.
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_().
|
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().
|
static |
Definition at line 606 of file xmlquery.c.
References check_diagnostic(), odr_malloc(), yaz_xml2query_attribute_element(), and yaz_xml2query_term().
Referenced by yaz_xml2query_rpnstructure().
|
static |
Definition at line 442 of file xmlquery.c.
References CLASS_ATTSET, intVal(), odr_malloc(), odr_strdup(), type, yaz_oid_std(), yaz_string_to_oid_odr(), Z_AttributeValue_complex, Z_AttributeValue_numeric, and Z_StringOrNumeric_string.
Referenced by yaz_xml2query_apt().
|
static |
Definition at line 361 of file xmlquery.c.
References boolVal(), Z_ProximityOperator::distance, Z_ProximityOperator::exclusion, intVal(), Z_ProximityOperator::known, odr_booldup(), odr_intdup(), odr_malloc(), odr_nullval(), Z_ProximityOperator::ordered, Z_ProximityOperator::relationType, type, Z_ProximityOperator::u, Z_ProximityOperator::which, yaz_xml_get_prop(), Z_Operator_and, Z_Operator_and_not, Z_Operator_or, Z_Operator_prox, Z_ProximityOperator_known, Z_ProximityOperator_private, Z_ProximityOperator_Prox_lessThanOrEqual, and Z_ProxUnit_word.
Referenced by yaz_xml2query_rpnstructure().
|
static |
Definition at line 748 of file xmlquery.c.
References CLASS_ATTSET, odr_malloc(), yaz_oid_std(), yaz_string_to_oid_odr(), yaz_xml2query_rpnstructure(), and yaz_xml_get_prop().
Referenced by yaz_xml2query_().
|
static |
Definition at line 687 of file xmlquery.c.
References Z_Operand::attributesPlusTerm, check_diagnostic(), odr_malloc(), Z_Operand::resultSetId, Z_Complex::roperator, Z_Complex::s1, Z_Complex::s2, Z_Operand::u, Z_Operand::which, yaz_xml2query_apt(), yaz_xml2query_operator(), yaz_xml2query_rset(), Z_Operand_APT, Z_Operand_resultSetId, Z_RPNStructure_complex, and Z_RPNStructure_simple.
Referenced by yaz_xml2query_rpn().
|
static |
Definition at line 673 of file xmlquery.c.
References strVal().
Referenced by yaz_xml2query_rpnstructure().
|
static |
Definition at line 542 of file xmlquery.c.
References intVal(), odr_create_Odr_oct(), odr_malloc(), odr_nullval(), strVal(), type, Z_Term_characterString, Z_Term_general, Z_Term_null, and Z_Term_numeric.
Referenced by yaz_xml2query_apt().