static char sru_method[10] = "soap";
static char sru_version[10] = "1.2";
+static char sru_recordPacking[10] = "";
static char *codeset = 0; /* character set for output */
static int hex_dump = 0;
static char *dump_file_prefix = 0;
printf("Only CQL and PQF supported in SRW\n");
return 0;
}
+ if (*sru_recordPacking)
+ sr->u.request->recordPacking = sru_recordPacking;
sru_maximumRecords = 0;
sr->u.request->maximumRecords = odr_intdup(out, 0);
sr->u.request->facetList = facet_list;
}
else
{
- int r = sscanf(arg, "%9s %9s", sru_method, sru_version);
+ int r = sscanf(arg, "%9s %9s %9s", sru_method, sru_version,
+ sru_recordPacking);
if (r >= 1)
{
if (!yaz_matchstr(sru_method, "post"))
return 0;
if (!parse_show_args(arg, setstring, &setno, &nos))
return 0;
+ if (*sru_recordPacking)
+ sr->u.request->recordPacking = sru_recordPacking;
sr->u.request->startRecord = odr_intdup(out, setno);
sru_maximumRecords = nos;
sr->u.request->maximumRecords = odr_intdup(out, nos);
{
xmlNodePtr ptr = method->children;
Z_SRW_searchRetrieveRequest *req;
+ char *recordPacking = 0;
+ char *recordXMLEscaping = 0;
(*p)->which = Z_SRW_searchRetrieve_request;
req = (*p)->u.request = (Z_SRW_searchRetrieveRequest *)
&req->maximumRecords))
;
else if (match_xsd_string(ptr, "recordPacking", o,
- &req->recordPacking))
+ &recordPacking))
+ ;
+ else if (match_xsd_string(ptr, "recordXMLEscaping", o,
+ &recordXMLEscaping))
;
else if (match_xsd_string(ptr, "recordSchema", o,
&req->recordSchema))
/* should put proper diagnostic here */
return -1;
}
+ if (!strcmp((*p)->srw_version, "2.0"))
+ {
+ req->recordPacking = recordXMLEscaping;
+ req->packing = recordPacking;
+ }
+ else
+ {
+ req->recordPacking = recordPacking;
+ }
}
else if (!xmlStrcmp(method->name, BAD_CAST "searchRetrieveResponse"))
{
}
add_xsd_integer(ptr, "startRecord", req->startRecord);
add_xsd_integer(ptr, "maximumRecords", req->maximumRecords);
- add_xsd_string(ptr, "recordPacking", req->recordPacking);
+ if (version2)
+ {
+ add_xsd_string(ptr, "recordXMLEscaping", req->recordPacking);
+ add_xsd_string(ptr, "recordPacking", req->packing);
+ }
+ else
+ add_xsd_string(ptr, "recordPacking", req->recordPacking);
add_xsd_string(ptr, "recordSchema", req->recordSchema);
add_xsd_string(ptr, "recordXPath", req->recordXPath);
add_xsd_integer(ptr, "resultSetTTL", req->resultSetTTL);
if (!version2)
add_xsd_string(ptr, "version", (*p)->srw_version);
- add_xsd_string(ptr, "recordPacking", req->recordPacking);
+ if (version2)
+ {
+ add_xsd_string(ptr, "recordXMLEscaping", req->recordPacking);
+ add_xsd_string(ptr, "recordPacking", req->packing);
+ }
+ else
+ add_xsd_string(ptr, "recordPacking", req->recordPacking);
add_xsd_string(ptr, "stylesheet", req->stylesheet);
add_xsd_string(ptr, "database", req->database);
}
sr->u.request->maximumRecords = 0;
sr->u.request->recordSchema = 0;
sr->u.request->recordPacking = 0;
+ sr->u.request->packing = 0;
sr->u.request->recordXPath = 0;
sr->u.request->database = 0;
sr->u.request->resultSetTTL = 0;
sr->u.explain_request = (Z_SRW_explainRequest *)
odr_malloc(o, sizeof(*sr->u.explain_request));
sr->u.explain_request->recordPacking = 0;
+ sr->u.explain_request->packing = 0;
sr->u.explain_request->database = 0;
sr->u.explain_request->stylesheet = 0;
break;
srw_pdu->u.request->maximumRecords);
yaz_add_name_value_str(encode, name, value, &i, "recordSchema",
srw_pdu->u.request->recordSchema);
- yaz_add_name_value_str(encode, name, value, &i, "recordPacking",
- srw_pdu->u.request->recordPacking);
+ if (version2)
+ {
+ yaz_add_name_value_str(encode, name, value, &i, "recordXMLEscaping",
+ srw_pdu->u.request->recordPacking);
+ yaz_add_name_value_str(encode, name, value, &i, "recordPacking",
+ srw_pdu->u.request->packing);
+ }
+ else
+ yaz_add_name_value_str(encode, name, value, &i, "recordPacking",
+ srw_pdu->u.request->recordPacking);
yaz_add_name_value_str(encode, name, value, &i, "recordXPath",
srw_pdu->u.request->recordXPath);
yaz_add_name_value_str(encode, name, value, &i, "stylesheet",
break;
case Z_SRW_explain_request:
value[i++] = "explain";
+
+ if (version2)
+ {
+ yaz_add_name_value_str(encode, name, value, &i, "recordXMLEscaping",
+ srw_pdu->u.explain_request->recordPacking);
+ yaz_add_name_value_str(encode, name, value, &i, "recordPacking",
+ srw_pdu->u.explain_request->packing);
+ }
+ else
+ yaz_add_name_value_str(encode, name, value, &i, "recordPacking",
+ srw_pdu->u.explain_request->recordPacking);
yaz_add_name_value_str(encode, name, value, &i, "stylesheet",
srw_pdu->u.explain_request->stylesheet);
break;