1 /* $Id: xmlutil.hpp,v 1.12 2007-05-09 21:23:09 adam Exp $
2 Copyright (c) 2005-2007, Index Data.
4 This file is part of Metaproxy.
6 Metaproxy is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
11 Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with Metaproxy; see the file LICENSE. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
27 #include <libxml/tree.h>
29 namespace metaproxy_1 {
31 std::string get_text(const struct _xmlAttr *ptr);
32 std::string get_text(const xmlNode *ptr);
33 bool get_bool(const xmlNode *ptr, bool default_value);
34 int get_int(const xmlNode *ptr, int default_value);
35 bool check_attribute(const _xmlAttr *ptr,
36 const std::string &ns,
37 const std::string &name);
38 bool is_attribute(const _xmlAttr *ptr,
39 const std::string &ns,
40 const std::string &name);
41 bool is_element(const xmlNode *ptr,
42 const std::string &ns,
43 const std::string &name);
44 bool is_element_mp(const xmlNode *ptr, const std::string &name);
45 bool check_element_mp(const xmlNode *ptr,
46 const std::string &name);
47 std::string get_route(const xmlNode *node);
49 const xmlNode* jump_to(const xmlNode* node, int node_type);
51 const xmlNode* jump_to_next(const xmlNode* node, int node_type);
53 const xmlNode* jump_to_children(const xmlNode* node, int node_type);
55 void check_empty(const xmlNode *node);
58 class XMLError : public std::runtime_error {
60 XMLError(const std::string msg) :
61 std::runtime_error("XMLError : " + msg) {} ;
69 * indent-tabs-mode: nil
70 * c-file-style: "stroustrup"
72 * vim: shiftwidth=4 tabstop=8 expandtab