#include <libxml/tree.h>
#include <assert.h>
#include <yaz/facet.h>
+#include <yaz/proto.h>
#include "sru-p.h"
char *yaz_negotiate_sru_version(char *input_ver)
const char* name = yaz_element_attribute_value_get(ptr, "facet", "code");
yaz_log(YLOG_DEBUG, "sru-proxy facet type: %s", name);
- list = yaz_use_attribute_create(odr, name);
+ list = zget_AttributeList_use_string(odr, name);
for (node = ptr->children; node; node = node->next) {
if (yaz_match_xsd_element(node, "facetvalue"))
num_terms++;
return 0;
}
+static void encode_echoed_args(xmlNodePtr ptr, Z_SRW_PDU *p, const char *name)
+{
+ Z_SRW_extra_arg *ea = p->extra_args;
+ if (ea)
+ {
+ xmlNode *p1 = xmlNewChild(ptr, 0, BAD_CAST name, 0);
+ xmlNode *p2 = 0;
+ for (; ea; ea = ea->next)
+ {
+ if (ea->name && ea->name[0] == 'x' && ea->name[1] == '-')
+ {
+ /* not really according to XSD as of July 2014 */
+ if (!p2)
+ p2 = xmlNewChild(p1, 0,
+ BAD_CAST "extraRequestData", 0);
+ /* skip +2: "x-" in element */
+ add_xsd_string(p2, ea->name + 2, ea->value);
+ }
+ else
+ add_xsd_string(p1, ea->name, ea->value);
+ }
+ }
+}
+
int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
void *client_data, const char *ns)
{
else if (yaz_match_xsd_string(ptr, "facetSort", o,
(char**) &facetSort))
;
+ else
+ ;
}
if (!req->query)
{
}
add_xsd_integer(ptr, "nextRecordPosition",
res->nextRecordPosition);
+ encode_echoed_args(ptr, *p, "echoedSearchRetrieveRequest");
if (res->num_diagnostics)
{
xmlNodePtr rptr = xmlNewChild(ptr, 0, BAD_CAST "diagnostics",
yaz_srw_record(o, ptr1, &res->record, &res->extra_record,
client_data, version2);
}
+ encode_echoed_args(ptr, *p, "echoedExplainRequest");
if (res->num_diagnostics)
{
xmlNodePtr rptr = xmlNewChild(ptr, 0, BAD_CAST "diagnostics",