Log XML2/XSLT errors to yaz_log
[idzebra-moved-to-github.git] / include / zebra_xpath.h
1 /* This file is part of the Zebra server.
2    Copyright (C) 2004-2013 Index Data
3
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
7 version.
8
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
12 for more details.
13
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
17
18 */
19
20 #ifndef ZEBRA_XPATH_H
21 #define ZEBRA_XPATH_H
22
23 #include <yaz/nmem.h>
24
25 #define XPATH_STEP_COUNT 10
26 struct xpath_predicate {
27     int which;
28     union {
29 #define XPATH_PREDICATE_RELATION 1
30         struct {
31             char *name;
32             char *op;
33             char *value;
34         } relation;
35 #define XPATH_PREDICATE_BOOLEAN 2
36         struct {
37             const char *op;
38             struct xpath_predicate *left;
39             struct xpath_predicate *right;
40         } boolean;
41     } u;
42 };
43
44 struct xpath_location_step {
45     char *part;
46     struct xpath_predicate *predicate;
47 };
48
49 int zebra_parse_xpath_str(const char *xpath_string,
50                           struct xpath_location_step *xpath,
51                           int max, NMEM mem);
52
53 void dump_xp_steps (struct xpath_location_step *xpath, int no);
54
55
56 #endif
57 /*
58  * Local variables:
59  * c-basic-offset: 4
60  * c-file-style: "Stroustrup"
61  * indent-tabs-mode: nil
62  * End:
63  * vim: shiftwidth=4 tabstop=8 expandtab
64  */
65