From 2aad12aff6d9f75e56109b2855434fb8d6ec57ac Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 17 Jun 2013 15:57:08 +0200 Subject: [PATCH] MARC XML parse: insert fake leader if missing YAZ-664 --- src/marc_read_xml.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/marc_read_xml.c b/src/marc_read_xml.c index d47bbab..97e99e5 100644 --- a/src/marc_read_xml.c +++ b/src/marc_read_xml.c @@ -185,18 +185,13 @@ static int yaz_marc_read_xml_leader(yaz_marc_t mt, const xmlNode **ptr_p, for(; p; p = p->next) if (p->type == XML_TEXT_NODE) leader = (const char *) p->content; - break; - } - else - { - yaz_marc_cprintf( - mt, "Expected element 'leader', got '%.80s'", ptr->name); } + break; } if (!leader) { - yaz_marc_cprintf(mt, "Missing element 'leader'"); - return -1; + yaz_marc_cprintf(mt, "Missing leader. Inserting fake leader"); + leader = "00000nam a22000000a 4500"; } if (strlen(leader) != 24) { -- 1.7.10.4