1 /* This file is part of the Zebra server.
2 Copyright (C) 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
23 #include "../api/testlib.h"
25 /** xpath2.c - index a a bit more complex sgml record and search in it */
27 const char *myrec[] = {
29 " <termId>10</termId> \n"
30 " <termName>Sauropoda</termName> \n"
31 " <termType>PT</termType> \n"
33 " <relationType>BT</relationType> \n"
34 " <termId>5</termId> \n"
35 " <termName>Brontosauria</termName> \n"
36 " <termType>PT</termType> \n"
39 " <relationType>NT</relationType> \n"
40 " <termId>11</termId> \n"
41 " <termName>Eusauropoda</termName> \n"
42 " <termType>PT</termType> \n"
47 " <termId>5</termId> \n"
48 " <termName>Brontosauria</termName> \n"
49 " <termType>PT</termType> \n"
51 " <relationType>BT</relationType> \n"
52 " <termId>4</termId> \n"
53 " <termName>Sauropodomorpha</termName> \n"
54 " <termType>PT</termType> \n"
57 " <relationType>NT</relationType> \n"
58 " <termId>6</termId> \n"
59 " <termName>Plateosauria</termName> \n"
60 " <termType>PT</termType> \n"
63 " <relationType>NT</relationType> \n"
64 " <termId>10</termId> \n"
65 " <termName>Sauropoda</termName> \n"
66 " <termType>PT</termType> \n"
72 static void tst(int argc, char **argv)
74 ZebraService zs = tl_start_up(0, argc, argv);
75 ZebraHandle zh = zebra_open(zs, 0);
76 YAZ_CHECK(tl_init_data(zh, myrec));
78 YAZ_CHECK(tl_query(zh, "@attr 1=/Zthes/termName Sauropoda", 1));
79 YAZ_CHECK(tl_query(zh, "@attr 1=/Zthes/relation/termName Sauropoda", 1));
81 YAZ_CHECK(tl_close_down(zh, zs));
89 * c-file-style: "Stroustrup"
90 * indent-tabs-mode: nil
92 * vim: shiftwidth=4 tabstop=8 expandtab