X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmarcdisp.c;h=1d408bec2d25a2c1ffbfd4d3af8030f0613228cf;hb=b925ea17d6f146a28d745b0d34e9eec6eafda21f;hp=1680ea50041ebae881550ae1da7111e656df842c;hpb=3a78b70f2e785e67e08b26c8e50101d10e054dbb;p=yaz-moved-to-github.git diff --git a/src/marcdisp.c b/src/marcdisp.c index 1680ea5..1d408be 100644 --- a/src/marcdisp.c +++ b/src/marcdisp.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2006, Index Data ApS * See the file LICENSE for details. * - * $Id: marcdisp.c,v 1.32 2006-08-01 09:28:04 adam Exp $ + * $Id: marcdisp.c,v 1.33 2006-08-28 12:34:40 adam Exp $ */ /** @@ -422,15 +422,20 @@ int yaz_marc_write_line(yaz_marc_t mt, WRBUF wr) wrbuf_puts (wr, mt->subfield_str); wrbuf_iconv_write(wr, mt->iconv_cd, s->code_data, using_code_len); - wrbuf_printf(wr, " "); + wrbuf_iconv_puts(wr, mt->iconv_cd, " "); wrbuf_iconv_puts(wr, mt->iconv_cd, s->code_data + using_code_len); + wrbuf_iconv_puts(wr, mt->iconv_cd, " "); + wr->pos--; } wrbuf_puts (wr, mt->endline_str); break; case YAZ_MARC_CONTROLFIELD: - wrbuf_printf(wr, "%s ", n->u.controlfield.tag); + wrbuf_printf(wr, "%s", n->u.controlfield.tag); + wrbuf_iconv_puts(wr, mt->iconv_cd, " "); wrbuf_iconv_puts(wr, mt->iconv_cd, n->u.controlfield.data); + wrbuf_iconv_puts(wr, mt->iconv_cd, " "); + wr->pos--; wrbuf_puts (wr, mt->endline_str); break; case YAZ_MARC_COMMENT: @@ -499,6 +504,7 @@ static int yaz_marc_write_marcxml_ns(yaz_marc_t mt, WRBUF wr, for (n = mt->nodes; n; n = n->next) { struct yaz_marc_subfield *s; + switch(n->which) { case YAZ_MARC_DATAFIELD: @@ -514,7 +520,7 @@ static int yaz_marc_write_marcxml_ns(yaz_marc_t mt, WRBUF wr, wrbuf_printf(wr, " ind%d=\"", i+1); wrbuf_iconv_write_cdata(wr, mt->iconv_cd, n->u.datafield.indicator+i, 1); - wrbuf_printf(wr, "\""); + wrbuf_iconv_puts(wr, mt->iconv_cd, "\""); } } wrbuf_printf(wr, ">\n"); @@ -528,14 +534,15 @@ static int yaz_marc_write_marcxml_ns(yaz_marc_t mt, WRBUF wr, : cdata_one_character(mt, s->code_data); - wrbuf_puts(wr, " iconv_cd, " iconv_cd, s->code_data, using_code_len); - wrbuf_puts(wr, "\">"); + wrbuf_iconv_puts(wr, mt->iconv_cd, "\">"); wrbuf_iconv_write_cdata(wr, mt->iconv_cd, s->code_data + using_code_len, strlen(s->code_data + using_code_len)); - wrbuf_puts(wr, "\n"); + wrbuf_iconv_puts(wr, mt->iconv_cd, ""); + wrbuf_puts(wr, "\n"); } wrbuf_printf(wr, " \n"); break; @@ -543,9 +550,10 @@ static int yaz_marc_write_marcxml_ns(yaz_marc_t mt, WRBUF wr, wrbuf_printf(wr, " iconv_cd, n->u.controlfield.tag, strlen(n->u.controlfield.tag)); - wrbuf_printf(wr, "\">"); + wrbuf_iconv_puts(wr, mt->iconv_cd, "\">"); wrbuf_iconv_puts(wr, mt->iconv_cd, n->u.controlfield.data); - wrbuf_printf(wr, "\n"); + wrbuf_iconv_puts(wr, mt->iconv_cd, ""); + wrbuf_puts(wr, "\n"); break; case YAZ_MARC_COMMENT: wrbuf_printf(wr, "