X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmarc_read_xml.c;h=8f4ffd66c82e549764f6ebfbcd3d7f4f29acd83b;hb=af1d725908fed3da0afa5d4a20c6e3359effe643;hp=2642dd4fcd0678544186905670b31a129d9f0bc4;hpb=54db174ec4113c44b05f3766dc6f8ad665968cfb;p=yaz-moved-to-github.git diff --git a/src/marc_read_xml.c b/src/marc_read_xml.c index 2642dd4..8f4ffd6 100644 --- a/src/marc_read_xml.c +++ b/src/marc_read_xml.c @@ -1,8 +1,8 @@ /* - * Copyright (C) 1995-2006, Index Data ApS + * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: marc_read_xml.c,v 1.1 2006-12-15 12:37:18 adam Exp $ + * $Id: marc_read_xml.c,v 1.4 2007-12-17 20:59:30 adam Exp $ */ /** @@ -74,7 +74,7 @@ int yaz_marc_read_xml_subfields(yaz_marc_t mt, const xmlNode *ptr) for (p = ptr->children; p ; p = p->next) if (p->type == XML_TEXT_NODE) ctrl_data_len += strlen((const char *)p->content); - ctrl_data_buf = nmem_malloc(nmem, ctrl_data_len+1); + ctrl_data_buf = (char *) nmem_malloc(nmem, ctrl_data_len+1); strcpy(ctrl_data_buf, (const char *)ptr_code->content); for (p = ptr->children; p ; p = p->next) if (p->type == XML_TEXT_NODE) @@ -224,6 +224,8 @@ static int yaz_marc_read_xml_fields(yaz_marc_t mt, const xmlNode *ptr) 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) {