projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Version 5.4.1
[yaz-moved-to-github.git]
/
src
/
marc_read_xml.c
diff --git
a/src/marc_read_xml.c
b/src/marc_read_xml.c
index
7691c7c
..
f1539c5
100644
(file)
--- a/
src/marc_read_xml.c
+++ b/
src/marc_read_xml.c
@@
-1,5
+1,5
@@
/* This file is part of the YAZ toolkit.
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2012 Index Data
+ * Copyright (C) Index Data
* See the file LICENSE for details.
*/
* See the file LICENSE for details.
*/
@@
-185,18
+185,14
@@
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;
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);
+ ptr = ptr->next;
}
}
+ break;
}
if (!leader)
{
}
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)
{
}
if (strlen(leader) != 24)
{
@@
-420,9
+416,9
@@
int yaz_marc_read_xml(yaz_marc_t mt, const xmlNode *ptr)
switch (format)
{
case YAZ_MARC_MARCXML:
switch (format)
{
case YAZ_MARC_MARCXML:
- return yaz_marc_read_xml_fields(mt, ptr->next, indicator_length);
+ return yaz_marc_read_xml_fields(mt, ptr, indicator_length);
case YAZ_MARC_TURBOMARC:
case YAZ_MARC_TURBOMARC:
- return yaz_marc_read_turbo_xml_fields(mt, ptr->next, indicator_length);
+ return yaz_marc_read_turbo_xml_fields(mt, ptr, indicator_length);
}
return -1;
}
}
return -1;
}