- yaz_add_srw_diagnostic(assoc->encode, &srw_res->diagnostics,
- &srw_res->num_diagnostics,
- 7, "recordId" );
+ if ( srw_req->record.recordData_len ){
+ if ( srw_req->record.recordSchema == 0 ){
+ yaz_add_sru_update_diagnostic(assoc->encode, &srw_res->diagnostics,
+ &srw_res->num_diagnostics,
+ 9, "recordSchema" );
+ }
+ else {
+ rr.record_schema = odr_strdup(assoc->encode,
+ srw_req->record.recordSchema );
+ }
+ switch (srw_req->record.recordPacking)
+ {
+ case Z_SRW_recordPacking_string:
+ rr.record_packing = "string";
+ break;
+ case Z_SRW_recordPacking_XML:
+ rr.record_packing = "xml";
+ break;
+ case Z_SRW_recordPacking_URL:
+ rr.record_packing = "url";
+ break;
+ }
+ rr.record_data = odr_strdupn(assoc->encode,
+ srw_req->record.recordData_buf,
+ srw_req->record.recordData_len );
+ rr.request_extra_record = srw_req->extra_record;
+ }
+ else {
+ yaz_add_sru_update_diagnostic(assoc->encode, &srw_res->diagnostics,
+ &srw_res->num_diagnostics,
+ 9, "recordIdentifier OR recordData" );
+ }