1 /* This file is part of the Zebra server.
2 Copyright (C) 1994-2010 Index Data
4 Zebra is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
9 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #include "../api/testlib.h"
22 /** xpath2.c - index a a bit more complex sgml record and search in it */
24 const char *myrec[] = {
26 " <termId>10</termId> \n"
27 " <termName>Sauropoda</termName> \n"
28 " <termType>PT</termType> \n"
30 " <relationType>BT</relationType> \n"
31 " <termId>5</termId> \n"
32 " <termName>Brontosauria</termName> \n"
33 " <termType>PT</termType> \n"
36 " <relationType>NT</relationType> \n"
37 " <termId>11</termId> \n"
38 " <termName>Eusauropoda</termName> \n"
39 " <termType>PT</termType> \n"
44 " <termId>5</termId> \n"
45 " <termName>Brontosauria</termName> \n"
46 " <termType>PT</termType> \n"
48 " <relationType>BT</relationType> \n"
49 " <termId>4</termId> \n"
50 " <termName>Sauropodomorpha</termName> \n"
51 " <termType>PT</termType> \n"
54 " <relationType>NT</relationType> \n"
55 " <termId>6</termId> \n"
56 " <termName>Plateosauria</termName> \n"
57 " <termType>PT</termType> \n"
60 " <relationType>NT</relationType> \n"
61 " <termId>10</termId> \n"
62 " <termName>Sauropoda</termName> \n"
63 " <termType>PT</termType> \n"
69 static void tst(int argc, char **argv)
71 ZebraService zs = tl_start_up(0, argc, argv);
72 ZebraHandle zh = zebra_open(zs, 0);
73 YAZ_CHECK(tl_init_data(zh, myrec));
75 YAZ_CHECK(tl_query(zh, "@attr 1=/Zthes/termName Sauropoda", 1));
76 YAZ_CHECK(tl_query(zh, "@attr 1=/Zthes/relation/termName Sauropoda", 1));
78 YAZ_CHECK(tl_close_down(zh, zs));
86 * c-file-style: "Stroustrup"
87 * indent-tabs-mode: nil
89 * vim: shiftwidth=4 tabstop=8 expandtab