/* * glade-xml-utils.c - This functions are based on gnome-print/libgpa/gpa-xml.c * which were in turn based on gnumeric/xml-io.c * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Authors: * Daniel Veillard * Miguel de Icaza * Chema Celorio */ /** * SECTION:glade-xml-utils * @Title: Xml Utils * @Short_Description: An api to read and write xml. * * You may need these tools if you are implementing #GladeReadWidgetFunc * and/or #GladeWriteWidgetFunc on your #GladeWidgetAdaptor to read * and write widgets in custom ways */ #include "config.h" #include #include #include #include "glade-xml-utils.h" #include "glade-catalog.h" #include "glade-utils.h" #include #include #include #include struct _GladeXmlNode { xmlNodePtr node; }; struct _GladeXmlDoc { xmlDocPtr doc; gint reference_count; }; struct _GladeXmlContext { GladeXmlDoc *doc; xmlNsPtr ns; }; G_DEFINE_BOXED_TYPE(GladeXmlNode, glade_xml_node, glade_xml_node_copy, glade_xml_node_delete) G_DEFINE_BOXED_TYPE(GladeXmlDoc, glade_xml_doc, glade_xml_doc_ref, glade_xml_doc_unref) G_DEFINE_BOXED_TYPE(GladeXmlContext, glade_xml_context, glade_xml_context_copy, glade_xml_context_free) static GladeXmlDoc *glade_xml_doc_new_from_doc (xmlDocPtr docptr); /* This is used inside for loops so that we skip xml comments *