1 /* $Id: xpath2.c,v 1.1 2004-10-29 14:16:22 heikki Exp $
2 Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
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
26 /** xpath2.c - index a a bit more complex sgml record and search in it */
28 const char *myrec[] = {
30 " <termId>10</termId> \n"
31 " <termName>Sauropoda</termName> \n"
32 " <termType>PT</termType> \n"
34 " <relationType>BT</relationType> \n"
35 " <termId>5</termId> \n"
36 " <termName>Brontosauria</termName> \n"
37 " <termType>PT</termType> \n"
40 " <relationType>NT</relationType> \n"
41 " <termId>11</termId> \n"
42 " <termName>Eusauropoda</termName> \n"
43 " <termType>PT</termType> \n"
48 " <termId>5</termId> \n"
49 " <termName>Brontosauria</termName> \n"
50 " <termType>PT</termType> \n"
52 " <relationType>BT</relationType> \n"
53 " <termId>4</termId> \n"
54 " <termName>Sauropodomorpha</termName> \n"
55 " <termType>PT</termType> \n"
58 " <relationType>NT</relationType> \n"
59 " <termId>6</termId> \n"
60 " <termName>Plateosauria</termName> \n"
61 " <termType>PT</termType> \n"
64 " <relationType>NT</relationType> \n"
65 " <termId>10</termId> \n"
66 " <termName>Sauropoda</termName> \n"
67 " <termType>PT</termType> \n"
73 int main(int argc, char **argv)
75 ZebraService zs = start_up("zebraxpath.cfg", argc, argv);
76 ZebraHandle zh = zebra_open (zs);
79 do_query(__LINE__,zh, "@attr 1=/Zthes/termName Sauropoda", 1);
80 do_query(__LINE__,zh, "@attr 1=/Zthes/relation/termName Sauropoda",1);
82 return close_down(zh, zs, 0);