1 /* This file is part of Metaproxy.
2 Copyright (C) 2005-2008 Index Data
4 Metaproxy 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 Metaproxy 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
24 #include <libxml/tree.h>
26 namespace metaproxy_1 {
28 std::string get_text(const struct _xmlAttr *ptr);
29 std::string get_text(const xmlNode *ptr);
30 bool get_bool(const xmlNode *ptr, bool default_value);
31 int get_int(const xmlNode *ptr, int default_value);
32 bool check_attribute(const _xmlAttr *ptr,
33 const std::string &ns,
34 const std::string &name);
35 bool is_attribute(const _xmlAttr *ptr,
36 const std::string &ns,
37 const std::string &name);
38 bool is_element(const xmlNode *ptr,
39 const std::string &ns,
40 const std::string &name);
41 bool is_element_mp(const xmlNode *ptr, const std::string &name);
42 bool check_element_mp(const xmlNode *ptr,
43 const std::string &name);
44 std::string get_route(const xmlNode *node);
46 const xmlNode* jump_to(const xmlNode* node, int node_type);
48 const xmlNode* jump_to_next(const xmlNode* node, int node_type);
50 const xmlNode* jump_to_children(const xmlNode* node, int node_type);
52 void check_empty(const xmlNode *node);
55 class XMLError : public std::runtime_error {
57 XMLError(const std::string msg) :
58 std::runtime_error("XMLError : " + msg) {} ;
66 * c-file-style: "Stroustrup"
67 * indent-tabs-mode: nil
69 * vim: shiftwidth=4 tabstop=8 expandtab