/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2013 Index Data
+ * Copyright (C) Index Data
* See the file LICENSE for details.
*/
/**
charset);
else if (r->which == Z_External_octet)
{
- if (yaz_oid_is_iso2709(oid))
+ if (oid_oidcmp(oid, yaz_oid_recsyn_xml)
+ && oid_oidcmp(oid, yaz_oid_recsyn_application_xml)
+ && oid_oidcmp(oid, yaz_oid_recsyn_mab)
+ && oid_oidcmp(oid, yaz_oid_recsyn_html))
{
const char *ret_buf = return_marc_record(
wrbuf, marctype, len,
charset);
if (ret_buf)
return ret_buf;
- /* bad ISO2709. Return fail unless raw (ISO2709) is wanted */
- if (marctype != YAZ_MARC_ISO2709)
+ /* 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,
ret = get_record_format(wrbuf, len, npr, YAZ_MARC_TURBOMARC, charset,
format);
}
+ else if (!strcmp(type, "json"))
+ {
+ ret = get_record_format(wrbuf, len, npr, YAZ_MARC_JSON, charset,
+ format);
+ }
else if (!strcmp(type, "raw"))
{
ret = get_record_format(wrbuf, len, npr, YAZ_MARC_ISO2709, charset,