X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fsrw.c;h=3573ea554e3ca0887b56ee3da9b69bb2e5f8556c;hb=c74c6895815390dd19ec8b4f346bdb32dc1b07bb;hp=0461f2f149591d6617d6421c5e3fe09aa27fda28;hpb=f64aa61c61bf8bf851d7b66a5fc137669dc77452;p=yaz-moved-to-github.git diff --git a/src/srw.c b/src/srw.c index 0461f2f..3573ea5 100644 --- a/src/srw.c +++ b/src/srw.c @@ -1,8 +1,8 @@ /* - * Copyright (c) 2002-2004, Index Data. + * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: srw.c,v 1.29 2005-01-08 01:20:19 adam Exp $ + * $Id: srw.c,v 1.33 2005-01-15 19:47:14 adam Exp $ */ /** * \file srw.c @@ -95,7 +95,10 @@ static int match_xsd_string_n(xmlNodePtr ptr, const char *elem, ODR o, #endif ptr = ptr->children; if (!ptr || ptr->type != XML_TEXT_NODE) - return 0; + { + *val = ""; + return 1; + } *val = odr_strdup(o, ptr->content); if (len) *len = strlen(ptr->content); @@ -353,6 +356,7 @@ static int yaz_srw_term(ODR o, xmlNodePtr pptr, Z_SRW_scanTerm *term, term->value = 0; term->numberOfRecords = 0; term->displayTerm = 0; + term->whereInList = 0; for (ptr = pptr->children; ptr; ptr = ptr->next) { if (match_xsd_string(ptr, "value", o, &term->value)) @@ -363,14 +367,18 @@ static int yaz_srw_term(ODR o, xmlNodePtr pptr, Z_SRW_scanTerm *term, else if (match_xsd_string(ptr, "displayTerm", o, &term->displayTerm)) ; + else if (match_xsd_string(ptr, "whereInList", o, + &term->whereInList)) + ; } } else if (o->direction == ODR_ENCODE) { xmlNodePtr ptr = pptr; add_xsd_string(ptr, "value", term->value); - add_xsd_integer(ptr, "value", term->numberOfRecords); + add_xsd_integer(ptr, "numberOfRecords", term->numberOfRecords); add_xsd_string(ptr, "displayTerm", term->displayTerm); + add_xsd_string(ptr, "whereInList", term->whereInList); } return 0; } @@ -620,6 +628,11 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data, else if (match_xsd_string(ptr, "scanClause", o, &req->scanClause.cql)) ; + else if (match_xsd_string(ptr, "pScanClause", o, + &req->scanClause.pqf)) + { + req->query_type = Z_SRW_query_type_pqf; + } else if (match_xsd_integer(ptr, "responsePosition", o, &req->responsePosition)) ;