Don't MARC decode XML/HTML
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 19 Aug 2013 09:13:36 +0000 (11:13 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 19 Aug 2013 09:13:36 +0000 (11:13 +0200)
client/client.c
src/record_render.c

index f354979..0147b06 100644 (file)
@@ -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);
index 6acb1d7..82da22c 100644 (file)
@@ -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,