X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Frecord_conv.c;h=b3ec821e6e743995e51488b04121ac607172d384;hp=6737503988b26293297959dfcd57d6b1dea5371b;hb=f15418ee295542935d616a2163377b71e40ce04f;hpb=2788a4851b551e1a3efb320a2878b809f2d8a9d7 diff --git a/src/record_conv.c b/src/record_conv.c index 6737503..b3ec821 100644 --- a/src/record_conv.c +++ b/src/record_conv.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2009 Index Data + * Copyright (C) 1995-2010 Index Data * See the file LICENSE for details. */ /** @@ -304,6 +304,12 @@ static int conv_marc(yaz_record_conv_t p, const xmlNode *ptr) if (input_charset && !output_charset) output_charset = "utf-8"; } + else if (!strcmp(output_format, "tmarcxml")) + { + output_format_mode = YAZ_MARC_TMARCXML; + if (input_charset && !output_charset) + output_charset = "utf-8"; + } else if (!strcmp(output_format, "marc")) { output_format_mode = YAZ_MARC_ISO2709; @@ -472,7 +478,8 @@ static int yaz_record_conv_record_rule(yaz_record_conv_t p, else ret = -1; } - else if (r->u.marc.input_format == YAZ_MARC_MARCXML) + else if (r->u.marc.input_format == YAZ_MARC_MARCXML || + r->u.marc.input_format == YAZ_MARC_TMARCXML) { xmlDocPtr doc = xmlParseMemory(wrbuf_buf(record), wrbuf_len(record)); @@ -483,7 +490,7 @@ static int yaz_record_conv_record_rule(yaz_record_conv_t p, } else { - ret = yaz_marc_read_xml(mt, xmlDocGetRootElement(doc)); + ret = yaz_marc_read_xml(mt, xmlDocGetRootElement(doc)); if (ret) wrbuf_printf(p->wr_error, "yaz_marc_read_xml failed"); } @@ -576,6 +583,7 @@ void yaz_record_conv_set_path(yaz_record_conv_t p, const char *path) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab