1 /* $Id: xpath1.c,v 1.6 2006-05-10 08:13:41 adam Exp $
2 Copyright (C) 1995-2005
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 Zebra; see the file LICENSE.zebra. If not, write to the
19 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #include "../api/testlib.h"
25 /** xpath1.c - index a simple sgml record and search in it */
27 static void tst(int argc, char **argv)
31 const char *myrec[] = {
41 zs = tl_start_up(0, argc, argv);
42 zh = zebra_open(zs, 0);
43 YAZ_CHECK(tl_init_data(zh, myrec));
45 YAZ_CHECK(tl_query(zh, "@attr 1=/sgml/tag before", 0));
46 YAZ_CHECK(tl_query(zh, "@attr 1=/sgml/tag inside", 1));
47 YAZ_CHECK(tl_query(zh, "@attr 1=/sgml/tag after", 0));
49 YAZ_CHECK(tl_query(zh, "@attr 1=/sgml/none after", 0));
50 YAZ_CHECK(tl_query(zh, "@attr 1=/sgml/none inside", 0));
52 YAZ_CHECK(tl_query(zh, "@attr 1=/sgml before", 1));
53 YAZ_CHECK(tl_query(zh, "@attr 1=/sgml inside", 1));
54 YAZ_CHECK(tl_query(zh, "@attr 1=/sgml after", 1));
56 YAZ_CHECK(tl_close_down(zh, zs));
63 * indent-tabs-mode: nil
65 * vim: shiftwidth=4 tabstop=8 expandtab