ns_srw = xmlNewNs(ptr, BAD_CAST ns, BAD_CAST "zs");
xmlSetNs(ptr, ns_srw);
- if (!version2)
- add_xsd_string(ptr, "version", (*p)->srw_version);
-
+ add_xsd_string(ptr, "version", (*p)->srw_version);
if (version2)
{
if (queryType)
ns_srw = xmlNewNs(ptr, BAD_CAST ns, BAD_CAST "zs");
xmlSetNs(ptr, ns_srw);
- if (!version2)
- add_xsd_string(ptr, "version", (*p)->srw_version);
+ add_xsd_string(ptr, "version", (*p)->srw_version);
add_xsd_integer(ptr, "numberOfRecords", res->numberOfRecords);
add_xsd_string(ptr, "resultSetId", res->resultSetId);
add_xsd_integer(ptr,
ns_srw = xmlNewNs(ptr, BAD_CAST ns, BAD_CAST "zs");
xmlSetNs(ptr, ns_srw);
- if (!version2)
- add_xsd_string(ptr, "version", (*p)->srw_version);
+ add_xsd_string(ptr, "version", (*p)->srw_version);
if (version2)
{
add_xsd_string(ptr, "recordXMLEscaping", req->recordPacking);
ns_srw = xmlNewNs(ptr, BAD_CAST ns, BAD_CAST "zs");
xmlSetNs(ptr, ns_srw);
- if (!version2)
- add_xsd_string(ptr, "version", (*p)->srw_version);
+ add_xsd_string(ptr, "version", (*p)->srw_version);
if (version2)
{
ns_srw = xmlNewNs(ptr, BAD_CAST ns, BAD_CAST "zs");
xmlSetNs(ptr, ns_srw);
- if (!version2)
- add_xsd_string(ptr, "version", (*p)->srw_version);
-
+ add_xsd_string(ptr, "version", (*p)->srw_version);
if (res->num_terms)
{
xmlNodePtr rptr = xmlNewChild(ptr, 0, BAD_CAST "terms", 0);
}
}
}
- if (!operation && query)
- operation = "searchRetrieve";
+ if (!operation)
+ {
+ if (query)
+ operation = "searchRetrieve";
+ else if (scanClause)
+ operation = "scan";
+ }
version = yaz_negotiate_sru_version(version);
if (!version)
int version2 = strcmp(srw_pdu->srw_version, "2.") > 0;
int i = 0;
char *queryType;
- if (!version2)
- yaz_add_name_value_str(encode, name, value, &i, "version", srw_pdu->srw_version);
+ yaz_add_name_value_str(encode, name, value, &i, "version",
+ srw_pdu->srw_version);
name[i] = "operation";
switch (srw_pdu->which)
{
case Z_SRW_searchRetrieve_request:
- if (!version2)
- value[i++] = "searchRetrieve";
+ value[i++] = "searchRetrieve";
queryType = srw_pdu->u.request->queryType;
if (version2)
{
- yaz_add_name_value_str(encode, name, value, &i, "queryType",
- queryType);
+ if (queryType && strcmp(queryType, "cql"))
+ yaz_add_name_value_str(encode, name, value, &i, "queryType",
+ queryType);
yaz_add_name_value_str(encode, name, value, &i, "query",
srw_pdu->u.request->query);
}