}
if (no_root_nodes != 1 && fixup_root)
{
+ /* does not appear to be an XML document. Make it so */
xmlBufferAddHead(buf, (const xmlChar *) "<yaz_record>", -1);
xmlBufferAdd(buf, (const xmlChar *) "</yaz_record>", -1);
}
- *val = (char *) odr_malloc(o, buf->use+1);
- memcpy (*val, buf->content, buf->use);
+ *val = (char *) odr_malloc(o, buf->use + 1);
+ memcpy(*val, buf->content, buf->use);
(*val)[buf->use] = '\0';
if (len)
if (!strcmp(input_ver, "1.1"))
return "1.1";
- return "1.2"; /* our latest supported version */
+ return "1.2"; /* our latest supported version */
}
static int yaz_srw_record(ODR o, xmlNodePtr pptr, Z_SRW_record *rec,
}
if (data_ptr)
{
- switch(pack)
+ switch (pack)
{
case Z_SRW_recordPacking_XML:
match_xsd_XML_n2(data_ptr, "recordData", o,
add_xsd_string(ptr, "recordSchema", rec->recordSchema);
if (spack)
add_xsd_string(ptr, "recordPacking", spack);
- switch(pack)
+ switch (pack)
{
case Z_SRW_recordPacking_string:
add_xsd_string_n(ptr, "recordData", rec->recordData_buf,
num_facets = 0;
for (node = ptr->children; node; node= node->next)
{
- if (match_element(node, "facet")) {
- facet_list_field_set(o, facet_list, yaz_sru_proxy_decode_facet_field(o, node), num_facets);
+ if (match_element(node, "facet"))
+ {
+ facet_list_field_set(
+ o, facet_list,
+ yaz_sru_proxy_decode_facet_field(o, node), num_facets);
num_facets++;
}
}
if ((*p)->srw_version)
add_xsd_string(ptr, "version", (*p)->srw_version);
- switch(req->query_type)
+ switch (req->query_type)
{
case Z_SRW_query_type_cql:
add_xsd_string(ptr, "query", req->query.cql);
add_xsd_string(ptr, "recordSchema", req->recordSchema);
add_xsd_string(ptr, "recordXPath", req->recordXPath);
add_xsd_integer(ptr, "resultSetTTL", req->resultSetTTL);
- switch(req->sort_type)
+ switch (req->sort_type)
{
case Z_SRW_sort_type_none:
break;
xmlSetNs(ptr, ns_srw);
add_xsd_string(ptr, "version", (*p)->srw_version);
- switch(req->query_type)
+ switch (req->query_type)
{
case Z_SRW_query_type_cql:
add_xsd_string(ptr, "scanClause", req->scanClause.cql);
;
else if (match_xsd_string(ptr, "action", o,
&oper)){
- if ( oper ){
- if ( !strcmp(oper, "info:srw/action/1/delete"))
+ if (oper)
+ {
+ if (!strcmp(oper, "info:srw/action/1/delete"))
req->operation = "delete";
else if (!strcmp(oper,"info:srw/action/1/replace" ))
req->operation = "replace";
- else if ( !strcmp( oper, "info:srw/action/1/create"))
+ else if (!strcmp(oper, "info:srw/action/1/create"))
req->operation = "insert";
}
}
Z_SRW_PDU **p = handler_data;
xmlNsPtr ns_ucp, ns_srw;
-
if ((*p)->which == Z_SRW_update_request)
{
Z_SRW_updateRequest *req = (*p)->u.update_request;
}
else
return -1;
-
}
return 0;
}