- {
- p->diagnostic = 238;
- break;
- }
- for (marctab = node->u.root.absyn->marc; marctab;
- marctab = marctab->next)
- if (marctab->reference == p->input_format)
- break;
- if (!marctab)
- {
- p->diagnostic = 238;
- break;
- }
- if (p->encoding)
- data1_iconv (p->dh, mem, node, p->encoding,
- data1_get_encoding(p->dh, node));
- if (!(p->rec_buf = data1_nodetomarc(p->dh, marctab, node,
- selected, &p->rec_len)))
- p->diagnostic = 238;
- else
- {
- char *new_buf = (char*) odr_malloc (p->odr, p->rec_len);
- memcpy (new_buf, p->rec_buf, p->rec_len);
- p->rec_buf = new_buf;
- }
+ p->diagnostic = YAZ_BIB1_RECORD_NOT_AVAILABLE_IN_REQUESTED_SYNTAX;
+ else
+ {
+ for (marctab = node->u.root.absyn->marc; marctab;
+ marctab = marctab->next)
+ if (marctab->oid && !oid_oidcmp(marctab->oid, p->input_format))
+ break;
+ if (!marctab)
+ p->diagnostic = YAZ_BIB1_RECORD_NOT_AVAILABLE_IN_REQUESTED_SYNTAX;
+ else
+ {
+ if (p->encoding)
+ data1_iconv (p->dh, mem, node, p->encoding,
+ data1_get_encoding(p->dh, node));
+ if (!(p->rec_buf = data1_nodetomarc(p->dh, marctab, node,
+ selected, &p->rec_len)))
+ p->diagnostic = YAZ_BIB1_RECORD_NOT_AVAILABLE_IN_REQUESTED_SYNTAX;
+ else
+ {
+ char *new_buf = (char*) odr_malloc (p->odr, p->rec_len);
+ memcpy (new_buf, p->rec_buf, p->rec_len);
+ p->rec_buf = new_buf;
+ }
+ }
+ }