1 /* $Id: xslt5.c,v 1.3 2006-12-16 09:04:28 adam Exp $
2 Copyright (C) 1995-2006
5 This file is part of the Zebra server.
7 Zebra is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 #include <libxml/xmlversion.h>
30 static void tst(int argc, char **argv)
33 char profile_path[256];
34 char record_buf[20000];
38 ZebraService zs = tl_start_up(0, argc, argv);
39 ZebraHandle zh = zebra_open(zs, 0);
41 tl_check_filter(zs, "alvis");
43 YAZ_CHECK_EQ(zebra_select_database(zh, "Default"), ZEBRA_OK);
47 sprintf(profile_path, "%s:%s/../../tab",
48 tl_get_srcdir(), tl_get_srcdir());
49 zebra_set_resource(zh, "profilePath", profile_path);
51 zebra_set_resource(zh, "recordType", "alvis.marcschema-one.xml");
53 sprintf(path, "%.200s/marc-missing-ns.xml", tl_get_srcdir());
54 f = fopen(path, "rb");
58 r = fread(record_buf, 1, sizeof(record_buf)-1, f);
65 /* disable this test for now: bug #730 */
66 /* http://xmlsoft.org/html/libxml-parser.html#xmlReadIO */
68 /* On Mac OSX using Libxml 2.6.16, we xmlTextReaderExpand does
69 not return 0 ptr even though the record has an error in it */
70 #if LIBXML_VERSION >= 20617
71 YAZ_CHECK_EQ(zebra_add_record(zh, record_buf, strlen(record_buf)),
74 zebra_add_record(zh, record_buf, strlen(record_buf));
79 YAZ_CHECK(tl_close_down(zh, zs));
87 * indent-tabs-mode: nil
89 * vim: shiftwidth=4 tabstop=8 expandtab