From: Dennis Schafroth Date: Wed, 10 Mar 2010 13:14:03 +0000 (+0100) Subject: Fixed: Generating correct xml after intro of turbo xml X-Git-Tag: v4.0.3~33^2~19 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=4a382949b64be5373386506e4b6f6c1e7c553d3d;p=yaz-moved-to-github.git Fixed: Generating correct xml after intro of turbo xml --- diff --git a/src/marcdisp.c b/src/marcdisp.c index 8a40939..46b1d80 100644 --- a/src/marcdisp.c +++ b/src/marcdisp.c @@ -611,9 +611,10 @@ static int yaz_marc_write_marcxml_ns1(yaz_marc_t mt, WRBUF wr, if (mt->enable_collection != no_collection) { - if (mt->enable_collection == collection_first) + if (mt->enable_collection == collection_first) { wrbuf_printf(wr, "<%s xmlns=\"%s\">\n", collection_name[turbo], ns); - mt->enable_collection = collection_second; + mt->enable_collection = collection_second; + } wrbuf_printf(wr, "<%s", record_name[turbo]); } else @@ -691,14 +692,16 @@ static int yaz_marc_write_marcxml_ns1(yaz_marc_t mt, WRBUF wr, strlen(s->code_data + using_code_len)); marc_iconv_reset(mt, wr); wrbuf_printf(wr, "iconv_cd, - s->code_data, using_code_len); + if (turbo) + wrbuf_iconv_write_cdata(wr, mt->iconv_cd, + s->code_data, using_code_len); wrbuf_puts(wr, ">\n"); } wrbuf_printf(wr, " iconv_cd, n->u.datafield.tag, - strlen(n->u.datafield.tag)); + if (turbo) + wrbuf_iconv_write_cdata(wr, mt->iconv_cd, n->u.datafield.tag, + strlen(n->u.datafield.tag)); wrbuf_printf(wr, ">\n", datafield_name[turbo]); break; case YAZ_MARC_CONTROLFIELD: @@ -721,8 +724,9 @@ static int yaz_marc_write_marcxml_ns1(yaz_marc_t mt, WRBUF wr, marc_iconv_reset(mt, wr); wrbuf_printf(wr, "iconv_cd, n->u.controlfield.tag, - strlen(n->u.controlfield.tag)); + if (turbo) + wrbuf_iconv_write_cdata(wr, mt->iconv_cd, n->u.controlfield.tag, + strlen(n->u.controlfield.tag)); wrbuf_puts(wr, ">\n"); break; case YAZ_MARC_COMMENT: @@ -735,10 +739,10 @@ static int yaz_marc_write_marcxml_ns1(yaz_marc_t mt, WRBUF wr, wrbuf_iconv_write_cdata(wr, 0 /* no charset conversion for leader */, n->u.leader, strlen(n->u.leader)); - wrbuf_printf(wr, " ", leader_name[turbo]); + wrbuf_printf(wr, "\n", leader_name[turbo]); } } - wrbuf_printf(wr, "", record_name[turbo]); + wrbuf_printf(wr, "\n", record_name[turbo]); return 0; }