X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fmarc_read_xml.c;h=3f5d29bdf17aab759093aa1a2d1d46d5d376e3a1;hp=caf5a5573a28a791b08dc2f93d94184b5bd8ca59;hb=379504a233e3e2cc85bca1e7b6d864f1395aec7c;hpb=fe507b6b15788a3a8e58063d9dae52532a5229a5 diff --git a/src/marc_read_xml.c b/src/marc_read_xml.c index caf5a55..3f5d29b 100644 --- a/src/marc_read_xml.c +++ b/src/marc_read_xml.c @@ -1,8 +1,6 @@ -/* - * Copyright (C) 1995-2007, Index Data ApS +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2009 Index Data * See the file LICENSE for details. - * - * $Id: marc_read_xml.c,v 1.3 2007-05-06 20:12:20 adam Exp $ */ /** @@ -118,7 +116,6 @@ static int yaz_marc_read_xml_leader(yaz_marc_t mt, const xmlNode **ptr_p) { yaz_marc_cprintf( mt, "Expected element 'leader', got '%.80s'", ptr->name); - return -1; } } if (!leader) @@ -194,7 +191,6 @@ static int yaz_marc_read_xml_fields(yaz_marc_t mt, const xmlNode *ptr) yaz_marc_cprintf( mt, "Bad attribute '%.80s' for 'datafield'", attr->name); - return -1; } if (!ptr_tag) { @@ -221,9 +217,11 @@ static int yaz_marc_read_xml_fields(yaz_marc_t mt, const xmlNode *ptr) } #endif +#if YAZ_HAVE_XML2 int yaz_marc_read_xml(yaz_marc_t mt, const xmlNode *ptr) { -#if YAZ_HAVE_XML2 + yaz_marc_reset(mt); + for(; ptr; ptr = ptr->next) if (ptr->type == XML_ELEMENT_NODE) { @@ -247,15 +245,14 @@ int yaz_marc_read_xml(yaz_marc_t mt, const xmlNode *ptr) if (yaz_marc_read_xml_leader(mt, &ptr)) return -1; return yaz_marc_read_xml_fields(mt, ptr->next); -#else - return -1; -#endif } +#endif /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab