Bump year. Change Aps->ApS
[idzebra-moved-to-github.git] / test / xpath / xpath2.c
1 /* $Id: xpath2.c,v 1.3 2005-01-15 19:38:40 adam Exp $
2    Copyright (C) 1995-2005
3    Index Data ApS
4
5 This file is part of the Zebra server.
6
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
10 version.
11
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
15 for more details.
16
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
20 02111-1307, USA.
21 */
22
23 #include "../api/testlib.h"
24
25 /** xpath2.c - index a a bit more complex sgml record and search in it */
26
27 const char *myrec[] = {
28     "<Zthes> \n"
29     " <termId>10</termId> \n"
30     " <termName>Sauropoda</termName> \n"
31     " <termType>PT</termType> \n"
32     " <relation> \n"
33     "  <relationType>BT</relationType> \n"
34     "  <termId>5</termId> \n"
35     "  <termName>Brontosauria</termName> \n"
36     "  <termType>PT</termType> \n"
37     " </relation> \n"
38     " <relation> \n"
39     "  <relationType>NT</relationType> \n"
40     "  <termId>11</termId> \n"
41     "  <termName>Eusauropoda</termName> \n"
42     "  <termType>PT</termType> \n"
43     " </relation> \n"
44     "</Zthes> \n",
45
46     "<Zthes> \n"
47     " <termId>5</termId> \n"
48     " <termName>Brontosauria</termName> \n"
49     " <termType>PT</termType> \n"
50     " <relation> \n"
51     "  <relationType>BT</relationType> \n"
52     "  <termId>4</termId> \n"
53     "  <termName>Sauropodomorpha</termName> \n"
54     "  <termType>PT</termType> \n"
55     " </relation> \n"
56     " <relation> \n"
57     "  <relationType>NT</relationType> \n"
58     "  <termId>6</termId> \n"
59     "  <termName>Plateosauria</termName> \n"
60     "  <termType>PT</termType> \n"
61     " </relation> \n"
62     " <relation> \n"
63     "  <relationType>NT</relationType> \n"
64     "  <termId>10</termId> \n"
65     "  <termName>Sauropoda</termName> \n"
66     "  <termType>PT</termType> \n"
67     " </relation> \n"
68     "</Zthes> \n",
69     0};
70
71
72 int main(int argc, char **argv)
73 {
74     ZebraService zs = start_up(0, argc, argv);
75     ZebraHandle zh = zebra_open (zs);
76     init_data(zh, myrec);
77
78     do_query(__LINE__,zh, "@attr 1=/Zthes/termName Sauropoda", 1);
79     do_query(__LINE__,zh, "@attr 1=/Zthes/relation/termName Sauropoda",1);
80
81     return close_down(zh, zs, 0);
82 }