X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fsrwutil.c;h=d284727f0241155d4ac9c6f9fe4813d2e3a8c53d;hb=refs%2Ftags%2FYAZ.2.0.9.larry;hp=16425c4fab851f7860e6dcb5ef863c93f41c4554;hpb=c82bbc07fb53f78aab88bb4121629daeef42ed2a;p=yaz-moved-to-github.git diff --git a/src/srwutil.c b/src/srwutil.c index 16425c4..d284727 100644 --- a/src/srwutil.c +++ b/src/srwutil.c @@ -1,8 +1,8 @@ /* - * Copyright (c) 2002-2003, Index Data. + * Copyright (c) 2002-2004, Index Data. * See the file LICENSE for details. * - * $Id: srwutil.c,v 1.3 2004-01-05 09:34:42 adam Exp $ + * $Id: srwutil.c,v 1.7 2004-01-07 22:27:41 adam Exp $ */ #include @@ -163,6 +163,7 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu, const char *operation = 0; char *query = 0; char *pQuery = 0; + char *stylesheet = 0; if (charset) *charset = 0; @@ -181,6 +182,7 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu, query = yaz_uri_val(p1, "query", decode); pQuery = yaz_uri_val(p1, "pQuery", decode); operation = yaz_uri_val(p1, "operation", decode); + stylesheet = yaz_uri_val(p1, "stylesheet", decode); if (!operation) operation = "explain"; if ((operation && !strcmp(operation, "searchRetrieve")) @@ -205,8 +207,11 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu, sr->u.request->sort_type = Z_SRW_sort_type_sort; sr->u.request->sort.sortKeys = sortKeys; } + sr->u.request->recordXPath = yaz_uri_val(p1, "recordXPath", decode); sr->u.request->recordSchema = yaz_uri_val(p1, "recordSchema", decode); sr->u.request->recordPacking = yaz_uri_val(p1, "recordPacking", decode); + sr->u.request->stylesheet = stylesheet; + if (!sr->u.request->recordPacking) sr->u.request->recordPacking = "xml"; yaz_uri_val_int(p1, "maximumRecords", decode, @@ -241,6 +246,8 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu, sr->u.explain_request->recordPacking = "xml"; sr->u.explain_request->database = db; + sr->u.explain_request->stylesheet = stylesheet; + (*soap_package) = odr_malloc(decode, sizeof(**soap_package)); (*soap_package)->which = Z_SOAP_generic; @@ -302,6 +309,7 @@ Z_SRW_PDU *yaz_srw_get(ODR o, int which) odr_malloc(o, sizeof(*sr->u.explain_request)); sr->u.explain_request->recordPacking = 0; sr->u.explain_request->database = 0; + sr->u.explain_request->stylesheet = 0; break; case Z_SRW_explain_response: sr->u.explain_response = (Z_SRW_explainResponse *) @@ -327,8 +335,8 @@ static struct { {2, "System temporarily unavailable"}, {3, "Authentication error"}, /* Diagnostics Relating to CQL */ -{10, "Illegal query"}, -{11, "Unsupported query type (XCQL vs CQL)"}, +{10, "Query syntax error"}, +{11, "Unsupported query type"}, {12, "Too many characters in query"}, {13, "Unbalanced or illegal use of parentheses"}, {14, "Unbalanced or illegal use of quotes"}, @@ -428,6 +436,7 @@ static int srw_bib1_map[] = { 7, 30, 8, 32, 9, 29, + 108, 10, /* Malformed query : Syntax error */ 10, 10, 11, 12, 11, 23, @@ -446,10 +455,10 @@ static int srw_bib1_map[] = { 20, 56, 21, 52, 22, 50, - 23, 1, /* bad map */ - 24, 63, /* bad map */ - 25, 63, /* bad map */ - 26, 63, /* bad map */ + 23, 3, + 24, 66, + 25, 66, + 26, 66, 27, 51, 28, 52, 29, 52,