From 6db306098a49682128a8e7bde44020fdf28fab62 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 19 Aug 2013 11:13:36 +0200 Subject: [PATCH] Don't MARC decode XML/HTML --- client/client.c | 2 +- src/record_render.c | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/client/client.c b/client/client.c index f354979..0147b06 100644 --- a/client/client.c +++ b/client/client.c @@ -923,7 +923,7 @@ static void display_record(Z_External *r) const char *octet_buf = (const char*)r->u.octet_aligned->buf; size_t octet_len = r->u.octet_aligned->len; if (!oid_oidcmp(oid, yaz_oid_recsyn_xml) - || !oid_oidcmp(oid, yaz_oid_recsyn_xml) + || !oid_oidcmp(oid, yaz_oid_recsyn_application_xml) || !oid_oidcmp(oid, yaz_oid_recsyn_html)) { print_xml_record(octet_buf, octet_len); diff --git a/src/record_render.c b/src/record_render.c index 6acb1d7..82da22c 100644 --- a/src/record_render.c +++ b/src/record_render.c @@ -167,16 +167,21 @@ static const char *return_record_wrbuf(WRBUF wrbuf, int *len, charset); else if (r->which == Z_External_octet) { - const char *ret_buf = return_marc_record( - wrbuf, marctype, len, - (const char *) r->u.octet_aligned->buf, - r->u.octet_aligned->len, - charset); - if (ret_buf) - return ret_buf; - /* not ISO2709. Return fail unless raw (ISO2709) is wanted */ - if (yaz_oid_is_iso2709(oid) && marctype != YAZ_MARC_ISO2709) - return 0; + if (oid_oidcmp(oid, yaz_oid_recsyn_xml) + && oid_oidcmp(oid, yaz_oid_recsyn_application_xml) + && oid_oidcmp(oid, yaz_oid_recsyn_html)) + { + const char *ret_buf = return_marc_record( + wrbuf, marctype, len, + (const char *) r->u.octet_aligned->buf, + r->u.octet_aligned->len, + charset); + if (ret_buf) + return ret_buf; + /* not ISO2709. Return fail unless raw (ISO2709) is wanted */ + if (yaz_oid_is_iso2709(oid) && marctype != YAZ_MARC_ISO2709) + return 0; + } return return_string_record(wrbuf, len, (const char *) r->u.octet_aligned->buf, r->u.octet_aligned->len, -- 1.7.10.4