2 * Copyright (C) 2006, 2007 OpenedHand Ltd.
4 * Author: Jorn Baayen <jorn@openedhand.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
22 #ifndef __XML_UTIL_H__
23 #define __XML_UTIL_H__
25 #include <libxml/tree.h>
26 #include <libsoup/soup-uri.h>
28 #include <glib-object.h>
30 /* Misc utilities for inspecting xmlNodes */
31 G_GNUC_INTERNAL xmlNode *
32 xml_util_get_element (xmlNode *node,
33 ...) G_GNUC_NULL_TERMINATED;
35 G_GNUC_INTERNAL xmlChar *
36 xml_util_get_child_element_content (xmlNode *node,
37 const char *child_name);
40 xml_util_get_child_element_content_int (xmlNode *node,
41 const char *child_name);
43 G_GNUC_INTERNAL char *
44 xml_util_get_child_element_content_glib (xmlNode *node,
45 const char *child_name);
47 G_GNUC_INTERNAL SoupURI *
48 xml_util_get_child_element_content_uri (xmlNode *node,
49 const char *child_name,
52 G_GNUC_INTERNAL char *
53 xml_util_get_child_element_content_url (xmlNode *node,
54 const char *child_name,
56 G_GNUC_INTERNAL xmlChar *
57 xml_util_get_attribute_contents (xmlNode *node,
58 const char *attribute_name);
60 G_GNUC_INTERNAL xmlNode *
61 xml_util_real_node (xmlNode *node);
63 /* XML string creation helpers */
64 G_GNUC_INTERNAL GString *
65 xml_util_new_string (void);
68 xml_util_start_element (GString *xml_str,
69 const char *element_name);
72 xml_util_end_element (GString *xml_str,
73 const char *element_name);
76 xml_util_add_content (GString *xml_str,
79 #endif /* __XML_UTIL_H__ */