/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2010 Index Data
+ * Copyright (C) Index Data
* See the file LICENSE for details.
*/
#include <config.h>
#endif
+#include <stdlib.h>
#include <yaz/options.h>
#include <yaz/record_conv.h>
case 'V':
break;
case 0:
+#if YAZ_HAVE_XML2
if (!p)
{
xmlDocPtr doc = xmlParseFile(arg);
}
while ((c = getc(f)) != EOF)
wrbuf_putc(input_record, c);
-
- r = yaz_record_conv_record(p,
+
+ r = yaz_record_conv_record(p,
wrbuf_buf(input_record),
wrbuf_len(input_record),
output_record);
if (r)
{
fprintf(stderr, "%s: %s: Error %s\n",
- prog, arg,
+ prog, arg,
yaz_record_conv_get_error(p));
no_errors++;
}
fclose(f);
}
break;
+#else
+ fprintf(stderr, "%s: YAZ not compiled with Libxml2 support\n",
+ prog);
+ usage();
+ break;
+#endif
default:
usage();
}
- }
+ }
+#if YAZ_HAVE_XML2
yaz_record_conv_destroy(p);
+#endif
if (no_errors)
exit(1);
exit(0);