+ case 'i':
+ input_format = yaz_marc_decode_formatstr(arg);
+ if (input_format == -1)
+ {
+ fprintf(stderr, "%s: bad input format: %s\n", prog, arg);
+ exit(1);
+ }
+#if YAZ_HAVE_XML2
+#else
+ if (input_format == YAZ_MARC_MARCXML
+ || input_format == YAZ_MARC_XCHANGE)
+ {
+ fprintf(stderr, "%s: Libxml2 support not enabled\n", prog);
+ exit(3);
+ }
+#endif
+ break;
+ case 'o':
+ /* dirty hack so we can make Libxml2 do the writing ..
+ rather than WRBUF */
+ if (strlen(arg) > 4 && strncmp(arg, "xml,", 4) == 0)
+ {
+ /* Only supported for Libxml2 2.6.0 or later */
+#if LIBXML_VERSION >= 20600
+ arg = arg + 4;
+ write_using_libxml2 = 1;
+#else
+ fprintf(stderr, "%s: output using Libxml2 unsupported\n", prog);
+ exit(4);
+#endif
+ }
+ output_format = yaz_marc_decode_formatstr(arg);
+ if (output_format == -1)
+ {
+ fprintf(stderr, "%s: bad output format: %s\n", prog, arg);
+ exit(1);
+ }
+ break;
+ case 'l':
+ leader_spec = arg;
+ break;