/* GHtml.c generated by valac 0.28.1, the Vala compiler
 * generated from GHtml.vala, do not modify */

/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
/* xNode.vala
 *
 * Copyright (C) 2015,2016  Yannick Inizan <inizan.yannick@gmail.com>
 * Copyright (C) 2015,2016  Daniel Espinosa <esodan@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library 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
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *      Yannick Inizan <inizan.yannick@gmail.com>
 *      Daniel Espinosa <esodan@gmail.com>
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <gio/gio.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/HTMLtree.h>
#include <libxml/HTMLparser.h>


#define GXML_TYPE_NODE (gxml_node_get_type ())
#define GXML_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_NODE, GXmlNode))
#define GXML_IS_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_NODE))
#define GXML_NODE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GXML_TYPE_NODE, GXmlNodeIface))

typedef struct _GXmlNode GXmlNode;
typedef struct _GXmlNodeIface GXmlNodeIface;

#define GXML_TYPE_ELEMENT_LIST (gxml_element_list_get_type ())
#define GXML_ELEMENT_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_ELEMENT_LIST, GXmlElementList))
#define GXML_ELEMENT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_ELEMENT_LIST, GXmlElementListClass))
#define GXML_IS_ELEMENT_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_ELEMENT_LIST))
#define GXML_IS_ELEMENT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_ELEMENT_LIST))
#define GXML_ELEMENT_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_ELEMENT_LIST, GXmlElementListClass))

typedef struct _GXmlElementList GXmlElementList;
typedef struct _GXmlElementListClass GXmlElementListClass;

#define GXML_TYPE_NAMESPACE (gxml_namespace_get_type ())
#define GXML_NAMESPACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_NAMESPACE, GXmlNamespace))
#define GXML_IS_NAMESPACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_NAMESPACE))
#define GXML_NAMESPACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GXML_TYPE_NAMESPACE, GXmlNamespaceIface))

typedef struct _GXmlNamespace GXmlNamespace;
typedef struct _GXmlNamespaceIface GXmlNamespaceIface;

#define GXML_TYPE_NODE_TYPE (gxml_node_type_get_type ())

#define GXML_TYPE_DOCUMENT (gxml_document_get_type ())
#define GXML_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_DOCUMENT, GXmlDocument))
#define GXML_IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_DOCUMENT))
#define GXML_DOCUMENT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GXML_TYPE_DOCUMENT, GXmlDocumentIface))

typedef struct _GXmlDocument GXmlDocument;
typedef struct _GXmlDocumentIface GXmlDocumentIface;

#define GXML_TYPE_XNODE (gxml_xnode_get_type ())
#define GXML_XNODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_XNODE, GXmlxNode))
#define GXML_XNODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_XNODE, GXmlxNodeClass))
#define GXML_IS_XNODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_XNODE))
#define GXML_IS_XNODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_XNODE))
#define GXML_XNODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_XNODE, GXmlxNodeClass))

typedef struct _GXmlxNode GXmlxNode;
typedef struct _GXmlxNodeClass GXmlxNodeClass;
typedef struct _GXmlxNodePrivate GXmlxNodePrivate;

#define GXML_TYPE_NAMESPACE_ATTR (gxml_namespace_attr_get_type ())
#define GXML_NAMESPACE_ATTR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_NAMESPACE_ATTR, GXmlNamespaceAttr))
#define GXML_NAMESPACE_ATTR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_NAMESPACE_ATTR, GXmlNamespaceAttrClass))
#define GXML_IS_NAMESPACE_ATTR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_NAMESPACE_ATTR))
#define GXML_IS_NAMESPACE_ATTR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_NAMESPACE_ATTR))
#define GXML_NAMESPACE_ATTR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_NAMESPACE_ATTR, GXmlNamespaceAttrClass))

typedef struct _GXmlNamespaceAttr GXmlNamespaceAttr;
typedef struct _GXmlNamespaceAttrClass GXmlNamespaceAttrClass;

#define GXML_TYPE_XNODE_LIST (gxml_xnode_list_get_type ())
#define GXML_XNODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_XNODE_LIST, GXmlxNodeList))
#define GXML_IS_XNODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_XNODE_LIST))
#define GXML_XNODE_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GXML_TYPE_XNODE_LIST, GXmlxNodeListIface))

typedef struct _GXmlxNodeList GXmlxNodeList;
typedef struct _GXmlxNodeListIface GXmlxNodeListIface;

#define GXML_TYPE_ABSTRACT_NAMED_ATTR_MAP (gxml_abstract_named_attr_map_get_type ())
#define GXML_ABSTRACT_NAMED_ATTR_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_ABSTRACT_NAMED_ATTR_MAP, GXmlAbstractNamedAttrMap))
#define GXML_ABSTRACT_NAMED_ATTR_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_ABSTRACT_NAMED_ATTR_MAP, GXmlAbstractNamedAttrMapClass))
#define GXML_IS_ABSTRACT_NAMED_ATTR_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_ABSTRACT_NAMED_ATTR_MAP))
#define GXML_IS_ABSTRACT_NAMED_ATTR_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_ABSTRACT_NAMED_ATTR_MAP))
#define GXML_ABSTRACT_NAMED_ATTR_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_ABSTRACT_NAMED_ATTR_MAP, GXmlAbstractNamedAttrMapClass))

typedef struct _GXmlAbstractNamedAttrMap GXmlAbstractNamedAttrMap;
typedef struct _GXmlAbstractNamedAttrMapClass GXmlAbstractNamedAttrMapClass;

#define GXML_TYPE_NAMED_ATTR_MAP (gxml_named_attr_map_get_type ())
#define GXML_NAMED_ATTR_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_NAMED_ATTR_MAP, GXmlNamedAttrMap))
#define GXML_NAMED_ATTR_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_NAMED_ATTR_MAP, GXmlNamedAttrMapClass))
#define GXML_IS_NAMED_ATTR_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_NAMED_ATTR_MAP))
#define GXML_IS_NAMED_ATTR_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_NAMED_ATTR_MAP))
#define GXML_NAMED_ATTR_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_NAMED_ATTR_MAP, GXmlNamedAttrMapClass))

typedef struct _GXmlNamedAttrMap GXmlNamedAttrMap;
typedef struct _GXmlNamedAttrMapClass GXmlNamedAttrMapClass;

#define GXML_TYPE_ABSTRACT_NAMESPACE_ATTR_NODE_LIST (gxml_abstract_namespace_attr_node_list_get_type ())
#define GXML_ABSTRACT_NAMESPACE_ATTR_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_ABSTRACT_NAMESPACE_ATTR_NODE_LIST, GXmlAbstractNamespaceAttrNodeList))
#define GXML_ABSTRACT_NAMESPACE_ATTR_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_ABSTRACT_NAMESPACE_ATTR_NODE_LIST, GXmlAbstractNamespaceAttrNodeListClass))
#define GXML_IS_ABSTRACT_NAMESPACE_ATTR_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_ABSTRACT_NAMESPACE_ATTR_NODE_LIST))
#define GXML_IS_ABSTRACT_NAMESPACE_ATTR_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_ABSTRACT_NAMESPACE_ATTR_NODE_LIST))
#define GXML_ABSTRACT_NAMESPACE_ATTR_NODE_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_ABSTRACT_NAMESPACE_ATTR_NODE_LIST, GXmlAbstractNamespaceAttrNodeListClass))

typedef struct _GXmlAbstractNamespaceAttrNodeList GXmlAbstractNamespaceAttrNodeList;
typedef struct _GXmlAbstractNamespaceAttrNodeListClass GXmlAbstractNamespaceAttrNodeListClass;

#define GXML_TYPE_NAMESPACE_ATTR_NODE_LIST (gxml_namespace_attr_node_list_get_type ())
#define GXML_NAMESPACE_ATTR_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_NAMESPACE_ATTR_NODE_LIST, GXmlNamespaceAttrNodeList))
#define GXML_NAMESPACE_ATTR_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_NAMESPACE_ATTR_NODE_LIST, GXmlNamespaceAttrNodeListClass))
#define GXML_IS_NAMESPACE_ATTR_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_NAMESPACE_ATTR_NODE_LIST))
#define GXML_IS_NAMESPACE_ATTR_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_NAMESPACE_ATTR_NODE_LIST))
#define GXML_NAMESPACE_ATTR_NODE_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_NAMESPACE_ATTR_NODE_LIST, GXmlNamespaceAttrNodeListClass))

typedef struct _GXmlNamespaceAttrNodeList GXmlNamespaceAttrNodeList;
typedef struct _GXmlNamespaceAttrNodeListClass GXmlNamespaceAttrNodeListClass;

#define GXML_TYPE_XDOCUMENT (gxml_xdocument_get_type ())
#define GXML_XDOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_XDOCUMENT, GXmlxDocument))
#define GXML_XDOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_XDOCUMENT, GXmlxDocumentClass))
#define GXML_IS_XDOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_XDOCUMENT))
#define GXML_IS_XDOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_XDOCUMENT))
#define GXML_XDOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_XDOCUMENT, GXmlxDocumentClass))

typedef struct _GXmlxDocument GXmlxDocument;
typedef struct _GXmlxDocumentClass GXmlxDocumentClass;
typedef struct _GXmlxDocumentPrivate GXmlxDocumentPrivate;

#define GXML_TYPE_BACKED_NODE (gxml_backed_node_get_type ())
#define GXML_BACKED_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_BACKED_NODE, GXmlBackedNode))
#define GXML_BACKED_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_BACKED_NODE, GXmlBackedNodeClass))
#define GXML_IS_BACKED_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_BACKED_NODE))
#define GXML_IS_BACKED_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_BACKED_NODE))
#define GXML_BACKED_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_BACKED_NODE, GXmlBackedNodeClass))

typedef struct _GXmlBackedNode GXmlBackedNode;
typedef struct _GXmlBackedNodeClass GXmlBackedNodeClass;

#define GXML_TYPE_XELEMENT (gxml_xelement_get_type ())
#define GXML_XELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_XELEMENT, GXmlxElement))
#define GXML_XELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_XELEMENT, GXmlxElementClass))
#define GXML_IS_XELEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_XELEMENT))
#define GXML_IS_XELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_XELEMENT))
#define GXML_XELEMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_XELEMENT, GXmlxElementClass))

typedef struct _GXmlxElement GXmlxElement;
typedef struct _GXmlxElementClass GXmlxElementClass;

#define GXML_TYPE_CHILD_NODE_LIST (gxml_child_node_list_get_type ())
#define GXML_CHILD_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_CHILD_NODE_LIST, GXmlChildNodeList))
#define GXML_CHILD_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_CHILD_NODE_LIST, GXmlChildNodeListClass))
#define GXML_IS_CHILD_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_CHILD_NODE_LIST))
#define GXML_IS_CHILD_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_CHILD_NODE_LIST))
#define GXML_CHILD_NODE_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_CHILD_NODE_LIST, GXmlChildNodeListClass))

typedef struct _GXmlChildNodeList GXmlChildNodeList;
typedef struct _GXmlChildNodeListClass GXmlChildNodeListClass;

#define GXML_TYPE_NODE_CHILD_NODE_LIST (gxml_node_child_node_list_get_type ())
#define GXML_NODE_CHILD_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_NODE_CHILD_NODE_LIST, GXmlNodeChildNodeList))
#define GXML_NODE_CHILD_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_NODE_CHILD_NODE_LIST, GXmlNodeChildNodeListClass))
#define GXML_IS_NODE_CHILD_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_NODE_CHILD_NODE_LIST))
#define GXML_IS_NODE_CHILD_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_NODE_CHILD_NODE_LIST))
#define GXML_NODE_CHILD_NODE_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_NODE_CHILD_NODE_LIST, GXmlNodeChildNodeListClass))

typedef struct _GXmlNodeChildNodeList GXmlNodeChildNodeList;
typedef struct _GXmlNodeChildNodeListClass GXmlNodeChildNodeListClass;

#define GXML_TYPE_HTML_DOCUMENT (gxml_html_document_get_type ())
#define GXML_HTML_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_HTML_DOCUMENT, GXmlHtmlDocument))
#define GXML_HTML_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_HTML_DOCUMENT, GXmlHtmlDocumentClass))
#define GXML_IS_HTML_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_HTML_DOCUMENT))
#define GXML_IS_HTML_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_HTML_DOCUMENT))
#define GXML_HTML_DOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_HTML_DOCUMENT, GXmlHtmlDocumentClass))

typedef struct _GXmlHtmlDocument GXmlHtmlDocument;
typedef struct _GXmlHtmlDocumentClass GXmlHtmlDocumentClass;
typedef struct _GXmlHtmlDocumentPrivate GXmlHtmlDocumentPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define GXML_TYPE_ELEMENT (gxml_element_get_type ())
#define GXML_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_ELEMENT, GXmlElement))
#define GXML_IS_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_ELEMENT))
#define GXML_ELEMENT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GXML_TYPE_ELEMENT, GXmlElementIface))

typedef struct _GXmlElement GXmlElement;
typedef struct _GXmlElementIface GXmlElementIface;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _GXmlNamespaceIface {
	GTypeInterface parent_iface;
	gchar* (*get_uri) (GXmlNamespace* self);
	gchar* (*get_prefix) (GXmlNamespace* self);
};

typedef enum  {
	GXML_NODE_TYPE_X_UNKNOWN = 0,
	GXML_NODE_TYPE_ELEMENT = 1,
	GXML_NODE_TYPE_ATTRIBUTE,
	GXML_NODE_TYPE_TEXT,
	GXML_NODE_TYPE_CDATA_SECTION,
	GXML_NODE_TYPE_ENTITY_REFERENCE,
	GXML_NODE_TYPE_ENTITY,
	GXML_NODE_TYPE_PROCESSING_INSTRUCTION,
	GXML_NODE_TYPE_COMMENT,
	GXML_NODE_TYPE_DOCUMENT,
	GXML_NODE_TYPE_DOCUMENT_TYPE,
	GXML_NODE_TYPE_DOCUMENT_FRAGMENT,
	GXML_NODE_TYPE_NOTATION
} GXmlNodeType;

struct _GXmlDocumentIface {
	GTypeInterface parent_iface;
	GXmlNode* (*create_element) (GXmlDocument* self, const gchar* name, GError** error);
	GXmlNode* (*create_text) (GXmlDocument* self, const gchar* text);
	GXmlNode* (*create_comment) (GXmlDocument* self, const gchar* text);
	GXmlNode* (*create_cdata) (GXmlDocument* self, const gchar* text);
	GXmlNode* (*create_pi) (GXmlDocument* self, const gchar* target, const gchar* data);
	gboolean (*save) (GXmlDocument* self, GCancellable* cancellable, GError** error);
	gboolean (*save_as) (GXmlDocument* self, GFile* f, GCancellable* cancellable, GError** error);
	gboolean (*get_indent) (GXmlDocument* self);
	void (*set_indent) (GXmlDocument* self, gboolean value);
	gboolean (*get_ns_top) (GXmlDocument* self);
	void (*set_ns_top) (GXmlDocument* self, gboolean value);
	gboolean (*get_prefix_default_ns) (GXmlDocument* self);
	void (*set_prefix_default_ns) (GXmlDocument* self, gboolean value);
	gboolean (*get_backup) (GXmlDocument* self);
	void (*set_backup) (GXmlDocument* self, gboolean value);
	GXmlNode* (*get_root) (GXmlDocument* self);
	GFile* (*get_file) (GXmlDocument* self);
	void (*set_file) (GXmlDocument* self, GFile* value);
};

struct _GXmlNodeIface {
	GTypeInterface parent_iface;
	GXmlNode* (*get) (GXmlNode* self, const gchar* key);
	GXmlElementList* (*get_elements_by_property_value) (GXmlNode* self, const gchar* property, const gchar* value);
	gchar* (*to_string) (GXmlNode* self);
	gboolean (*set_namespace) (GXmlNode* self, const gchar* uri, const gchar* prefix);
	gchar* (*ns_prefix) (GXmlNode* self);
	gchar* (*ns_uri) (GXmlNode* self);
	GeeList* (*get_namespaces) (GXmlNode* self);
	GeeBidirList* (*get_childs) (GXmlNode* self);
	GeeBidirList* (*get_children) (GXmlNode* self);
	GeeMap* (*get_attrs) (GXmlNode* self);
	gchar* (*get_name) (GXmlNode* self);
	gchar* (*get_value) (GXmlNode* self);
	void (*set_value) (GXmlNode* self, const gchar* value);
	GXmlNodeType (*get_type_node) (GXmlNode* self);
	GXmlDocument* (*get_document) (GXmlNode* self);
	GXmlNode* (*get_parent) (GXmlNode* self);
};

struct _GXmlxNodeListIface {
	GTypeInterface parent_iface;
	GXmlxNode* (*item) (GXmlxNodeList* self, gulong idx);
	GXmlxNode* (*insert_before) (GXmlxNodeList* self, GXmlxNode* new_child, GXmlxNode* ref_child);
	GXmlxNode* (*replace_child) (GXmlxNodeList* self, GXmlxNode* new_child, GXmlxNode* old_child);
	GXmlxNode* (*remove_child) (GXmlxNodeList* self, GXmlxNode* old_child);
	GXmlxNode* (*append_child) (GXmlxNodeList* self, GXmlxNode* new_child);
	gchar* (*to_string) (GXmlxNodeList* self, gboolean in_line);
	GXmlxNode* (*first) (GXmlxNodeList* self);
	GXmlxNode* (*last) (GXmlxNodeList* self);
	GXmlxNode* (*get) (GXmlxNodeList* self, gint n);
	gulong (*get_length) (GXmlxNodeList* self);
	void (*set_length) (GXmlxNodeList* self, gulong value);
};

struct _GXmlxNode {
	GObject parent_instance;
	GXmlxNodePrivate * priv;
	GXmlxNodeList* _child_nodes;
	GXmlNamedAttrMap* _attributes;
	GXmlNamespaceAttrNodeList* _namespace_definitions;
};

struct _GXmlxNodeClass {
	GObjectClass parent_class;
	GXmlNamespaceAttr* (*add_namespace_attr) (GXmlxNode* self, const gchar* uri, const gchar* namespace_prefix);
	gboolean (*set_namespace) (GXmlxNode* self, const gchar* uri, const gchar* namespace_prefix);
	GXmlxNode* (*insert_before) (GXmlxNode* self, GXmlxNode* new_child, GXmlxNode* ref_child);
	GXmlxNode* (*replace_child) (GXmlxNode* self, GXmlxNode* new_child, GXmlxNode* old_child);
	GXmlxNode* (*remove_child) (GXmlxNode* self, GXmlxNode* old_child);
	GXmlxNode* (*append_child) (GXmlxNode* self, GXmlxNode* new_child);
	gboolean (*has_child_nodes) (GXmlxNode* self);
	GXmlxNode* (*clone_node) (GXmlxNode* self, gboolean deep);
	gchar* (*stringify) (GXmlxNode* self, gboolean format, gint level);
	gchar* (*to_string) (GXmlxNode* self);
	GeeList* (*get_namespace_definitions) (GXmlxNode* self);
	void (*set_namespace_definitions) (GXmlxNode* self, GeeList* value);
	const gchar* (*get_namespace_uri) (GXmlxNode* self);
	void (*set_namespace_uri) (GXmlxNode* self, const gchar* value);
	const gchar* (*get_namespace_prefix) (GXmlxNode* self);
	void (*set_namespace_prefix) (GXmlxNode* self, const gchar* value);
	const gchar* (*get_local_name) (GXmlxNode* self);
	void (*set_local_name) (GXmlxNode* self, const gchar* value);
	const gchar* (*get_node_name) (GXmlxNode* self);
	void (*set_node_name) (GXmlxNode* self, const gchar* value);
	const gchar* (*get_node_value) (GXmlxNode* self);
	void (*set_node_value) (GXmlxNode* self, const gchar* value);
	GXmlNodeType (*get_node_type) (GXmlxNode* self);
	void (*set_node_type) (GXmlxNode* self, GXmlNodeType value);
	GXmlxNode* (*get_parent_node) (GXmlxNode* self);
	void (*set_parent_node) (GXmlxNode* self, GXmlxNode* value);
	GXmlxNodeList* (*get_child_nodes) (GXmlxNode* self);
	void (*set_child_nodes) (GXmlxNode* self, GXmlxNodeList* value);
	GXmlxNode* (*get_first_child) (GXmlxNode* self);
	void (*set_first_child) (GXmlxNode* self, GXmlxNode* value);
	GXmlxNode* (*get_last_child) (GXmlxNode* self);
	void (*set_last_child) (GXmlxNode* self, GXmlxNode* value);
	GXmlxNode* (*get_previous_sibling) (GXmlxNode* self);
	void (*set_previous_sibling) (GXmlxNode* self, GXmlxNode* value);
	GXmlxNode* (*get_next_sibling) (GXmlxNode* self);
	void (*set_next_sibling) (GXmlxNode* self, GXmlxNode* value);
	GXmlNamedAttrMap* (*get_attributes) (GXmlxNode* self);
	void (*set_attributes) (GXmlxNode* self, GXmlNamedAttrMap* value);
	GeeList* (*get_namespaces) (GXmlxNode* self);
	GeeBidirList* (*get_children) (GXmlxNode* self);
	GeeMap* (*get_attrs) (GXmlxNode* self);
	gchar* (*get_name) (GXmlxNode* self);
	gchar* (*get_value) (GXmlxNode* self);
	void (*set_value) (GXmlxNode* self, const gchar* value);
	GXmlNode* (*get_parent) (GXmlxNode* self);
};

struct _GXmlxDocument {
	GXmlxNode parent_instance;
	GXmlxDocumentPrivate * priv;
	GHashTable* node_dict;
	GList* dirty_elements;
	xmlDoc* xmldoc;
	GXmlNodeChildNodeList* _node_list;
};

struct _GXmlxDocumentClass {
	GXmlxNodeClass parent_class;
	GXmlNode* (*get_root) (GXmlxDocument* self);
};

struct _GXmlHtmlDocument {
	GXmlxDocument parent_instance;
	GXmlHtmlDocumentPrivate * priv;
};

struct _GXmlHtmlDocumentClass {
	GXmlxDocumentClass parent_class;
};

struct _GXmlElementIface {
	GTypeInterface parent_iface;
	void (*normalize) (GXmlElement* self);
	void (*set_attr) (GXmlElement* self, const gchar* name, const gchar* value);
	GXmlNode* (*get_attr) (GXmlElement* self, const gchar* name);
	void (*remove_attr) (GXmlElement* self, const gchar* name);
	void (*set_ns_attr) (GXmlElement* self, GXmlNamespace* ns, const gchar* name, const gchar* value);
	GXmlNode* (*get_ns_attr) (GXmlElement* self, const gchar* name, const gchar* uri);
	gchar* (*get_tag_name) (GXmlElement* self);
	gchar* (*get_content) (GXmlElement* self);
	void (*set_content) (GXmlElement* self, const gchar* value);
};


static gpointer gxml_html_document_parent_class = NULL;

GType gxml_element_list_get_type (void) G_GNUC_CONST;
GType gxml_namespace_get_type (void) G_GNUC_CONST;
GType gxml_node_type_get_type (void) G_GNUC_CONST;
GType gxml_document_get_type (void) G_GNUC_CONST;
GType gxml_node_get_type (void) G_GNUC_CONST;
GType gxml_xnode_get_type (void) G_GNUC_CONST;
GType gxml_namespace_attr_get_type (void) G_GNUC_CONST;
GType gxml_xnode_list_get_type (void) G_GNUC_CONST;
GType gxml_abstract_named_attr_map_get_type (void) G_GNUC_CONST;
GType gxml_named_attr_map_get_type (void) G_GNUC_CONST;
GType gxml_abstract_namespace_attr_node_list_get_type (void) G_GNUC_CONST;
GType gxml_namespace_attr_node_list_get_type (void) G_GNUC_CONST;
GType gxml_xdocument_get_type (void) G_GNUC_CONST;
GType gxml_backed_node_get_type (void) G_GNUC_CONST;
GType gxml_xelement_get_type (void) G_GNUC_CONST;
GType gxml_child_node_list_get_type (void) G_GNUC_CONST;
GType gxml_node_child_node_list_get_type (void) G_GNUC_CONST;
GType gxml_html_document_get_type (void) G_GNUC_CONST;
enum  {
	GXML_HTML_DOCUMENT_DUMMY_PROPERTY
};
GXmlHtmlDocument* gxml_html_document_new_from_path (const gchar* path, gint options, GError** error);
GXmlHtmlDocument* gxml_html_document_construct_from_path (GType object_type, const gchar* path, gint options, GError** error);
GXmlHtmlDocument* gxml_html_document_new_from_file (GFile* file, gint options, GCancellable* cancel, GError** error);
GXmlHtmlDocument* gxml_html_document_construct_from_file (GType object_type, GFile* file, gint options, GCancellable* cancel, GError** error);
GXmlHtmlDocument* gxml_html_document_new_from_uri (const gchar* uri, gint options, GError** error);
GXmlHtmlDocument* gxml_html_document_construct_from_uri (GType object_type, const gchar* uri, gint options, GError** error);
GXmlHtmlDocument* gxml_html_document_new_from_string (const gchar* html, gint options);
GXmlHtmlDocument* gxml_html_document_construct_from_string (GType object_type, const gchar* html, gint options);
GXmlxDocument* gxml_xdocument_new_from_libxml2 (xmlDoc* doc, gboolean require_root);
GXmlxDocument* gxml_xdocument_construct_from_libxml2 (GType object_type, xmlDoc* doc, gboolean require_root);
GXmlElementList* gxml_html_document_get_elements_by_class_name (GXmlHtmlDocument* self, const gchar* klass);
GXmlElementList* gxml_element_list_new (void);
GXmlElementList* gxml_element_list_construct (GType object_type);
GXmlNode* gxml_xdocument_get_root (GXmlxDocument* self);
GXmlElementList* gxml_node_get_elements_by_property_value (GXmlNode* self, const gchar* property, const gchar* value);
GType gxml_element_get_type (void) G_GNUC_CONST;
GXmlElement* gxml_element_list_get (GXmlElementList* self, gint index);
GeeMap* gxml_node_get_attrs (GXmlNode* self);
gchar* gxml_node_get_value (GXmlNode* self);
GXmlElement* gxml_html_document_get_element_by_id (GXmlHtmlDocument* self, const gchar* id);
GXmlHtmlDocument* gxml_html_document_new (void);
GXmlHtmlDocument* gxml_html_document_construct (GType object_type);
GXmlxDocument* gxml_xdocument_new (void);
GXmlxDocument* gxml_xdocument_construct (GType object_type);
gint gxml_html_document_get_default_options (void);
static void _vala_gxml_html_document_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);


GXmlHtmlDocument* gxml_html_document_construct_from_path (GType object_type, const gchar* path, gint options, GError** error) {
	GXmlHtmlDocument * self = NULL;
	const gchar* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (path != NULL, NULL);
	_tmp0_ = path;
	_tmp1_ = g_file_new_for_path (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = options;
	self = (GXmlHtmlDocument*) gxml_html_document_construct_from_file (object_type, _tmp2_, _tmp3_, NULL, &_inner_error_);
	_g_object_unref0 (_tmp2_);
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		_g_object_unref0 (self);
		return NULL;
	}
	return self;
}


GXmlHtmlDocument* gxml_html_document_new_from_path (const gchar* path, gint options, GError** error) {
	return gxml_html_document_construct_from_path (GXML_TYPE_HTML_DOCUMENT, path, options, error);
}


GXmlHtmlDocument* gxml_html_document_construct_from_uri (GType object_type, const gchar* uri, gint options, GError** error) {
	GXmlHtmlDocument * self = NULL;
	const gchar* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (uri != NULL, NULL);
	_tmp0_ = uri;
	_tmp1_ = g_file_new_for_uri (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = options;
	self = (GXmlHtmlDocument*) gxml_html_document_construct_from_file (object_type, _tmp2_, _tmp3_, NULL, &_inner_error_);
	_g_object_unref0 (_tmp2_);
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		_g_object_unref0 (self);
		return NULL;
	}
	return self;
}


GXmlHtmlDocument* gxml_html_document_new_from_uri (const gchar* uri, gint options, GError** error) {
	return gxml_html_document_construct_from_uri (GXML_TYPE_HTML_DOCUMENT, uri, options, error);
}


GXmlHtmlDocument* gxml_html_document_construct_from_file (GType object_type, GFile* file, gint options, GCancellable* cancel, GError** error) {
	GXmlHtmlDocument * self = NULL;
	guint8* data = NULL;
	gint data_length1 = 0;
	gint _data_size_ = 0;
	GFile* _tmp0_ = NULL;
	GCancellable* _tmp1_ = NULL;
	guint8* _tmp2_ = NULL;
	gsize _tmp3_;
	gint _tmp4_ = 0;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (file != NULL, NULL);
	_tmp0_ = file;
	_tmp1_ = cancel;
	g_file_load_contents (_tmp0_, _tmp1_, &_tmp2_, &_tmp3_, NULL, &_inner_error_);
	data = (g_free (data), NULL);
	data = _tmp2_;
	data_length1 = _tmp3_;
	_data_size_ = data_length1;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		data = (g_free (data), NULL);
		_g_object_unref0 (self);
		return NULL;
	}
	_tmp4_ = options;
	self = (GXmlHtmlDocument*) gxml_html_document_construct_from_string (object_type, (const gchar*) data, _tmp4_);
	data = (g_free (data), NULL);
	return self;
}


GXmlHtmlDocument* gxml_html_document_new_from_file (GFile* file, gint options, GCancellable* cancel, GError** error) {
	return gxml_html_document_construct_from_file (GXML_TYPE_HTML_DOCUMENT, file, options, cancel, error);
}


static gchar* string_to_utf8 (const gchar* self, int* result_length1) {
	gchar* result = NULL;
	gchar* _result_ = NULL;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	gchar* _tmp2_ = NULL;
	gint _result__length1 = 0;
	gint __result__size_ = 0;
	gint _tmp3_ = 0;
	gchar* _tmp4_ = NULL;
	gint _tmp4__length1 = 0;
	gint _tmp5_ = 0;
	gint _tmp6_ = 0;
	gchar* _tmp7_ = NULL;
	gint _tmp7__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_new0 (gchar, _tmp1_ + 1);
	_result_ = _tmp2_;
	_result__length1 = _tmp1_ + 1;
	__result__size_ = _result__length1;
	_tmp3_ = _result__length1;
	_result__length1 = _tmp3_ - 1;
	_tmp4_ = _result_;
	_tmp4__length1 = _result__length1;
	_tmp5_ = strlen (self);
	_tmp6_ = _tmp5_;
	memcpy (_tmp4_, self, (gsize) _tmp6_);
	_tmp7_ = _result_;
	_tmp7__length1 = _result__length1;
	if (result_length1) {
		*result_length1 = _tmp7__length1;
	}
	result = _tmp7_;
	return result;
}


GXmlHtmlDocument* gxml_html_document_construct_from_string (GType object_type, const gchar* html, gint options) {
	GXmlHtmlDocument * self = NULL;
	const gchar* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
	const gchar* _tmp4_ = NULL;
	gint _tmp5_ = 0;
	gint _tmp6_ = 0;
	gint _tmp7_ = 0;
	xmlDoc* _tmp8_ = NULL;
	g_return_val_if_fail (html != NULL, NULL);
	_tmp0_ = html;
	_tmp2_ = string_to_utf8 (_tmp0_, &_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp3__length1 = _tmp1_;
	_tmp4_ = html;
	_tmp5_ = strlen (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = options;
	_tmp8_ = htmlReadMemory (_tmp3_, _tmp6_, "", NULL, _tmp7_);
	self = (GXmlHtmlDocument*) gxml_xdocument_construct_from_libxml2 (object_type, _tmp8_, TRUE);
	_tmp3_ = (g_free (_tmp3_), NULL);
	return self;
}


GXmlHtmlDocument* gxml_html_document_new_from_string (const gchar* html, gint options) {
	return gxml_html_document_construct_from_string (GXML_TYPE_HTML_DOCUMENT, html, options);
}


/**
 * Search all {@link GXml.Element} with a property called "class" and with a
 * value as a class apply to a node.
 */
static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


static gboolean string_contains (const gchar* self, const gchar* needle) {
	gboolean result = FALSE;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = needle;
	_tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_);
	result = _tmp1_ != NULL;
	return result;
}


GXmlElementList* gxml_html_document_get_elements_by_class_name (GXmlHtmlDocument* self, const gchar* klass) {
	GXmlElementList* result = NULL;
	GXmlElementList* rl = NULL;
	GXmlElementList* _tmp0_ = NULL;
	GXmlElementList* l = NULL;
	GXmlNode* _tmp1_ = NULL;
	GXmlNode* _tmp2_ = NULL;
	GXmlNode* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	GXmlElementList* _tmp5_ = NULL;
	GXmlElementList* _tmp6_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (klass != NULL, NULL);
	_tmp0_ = gxml_element_list_new ();
	rl = _tmp0_;
	_tmp1_ = gxml_xdocument_get_root ((GXmlxDocument*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = klass;
	_tmp5_ = gxml_node_get_elements_by_property_value (_tmp3_, "class", _tmp4_);
	_tmp6_ = _tmp5_;
	_g_object_unref0 (_tmp3_);
	l = _tmp6_;
	{
		GXmlElementList* _n_list = NULL;
		GXmlElementList* _tmp7_ = NULL;
		GXmlElementList* _tmp8_ = NULL;
		gint _n_size = 0;
		GXmlElementList* _tmp9_ = NULL;
		gint _tmp10_ = 0;
		gint _tmp11_ = 0;
		gint _n_index = 0;
		_tmp7_ = l;
		_tmp8_ = _g_object_ref0 (_tmp7_);
		_n_list = _tmp8_;
		_tmp9_ = _n_list;
		_tmp10_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp9_);
		_tmp11_ = _tmp10_;
		_n_size = _tmp11_;
		_n_index = -1;
		while (TRUE) {
			gint _tmp12_ = 0;
			gint _tmp13_ = 0;
			gint _tmp14_ = 0;
			GXmlNode* n = NULL;
			GXmlElementList* _tmp15_ = NULL;
			gint _tmp16_ = 0;
			GXmlElement* _tmp17_ = NULL;
			GXmlNode* _tmp18_ = NULL;
			GXmlNode* p = NULL;
			GXmlNode* _tmp19_ = NULL;
			GeeMap* _tmp20_ = NULL;
			GeeMap* _tmp21_ = NULL;
			GeeMap* _tmp22_ = NULL;
			gpointer _tmp23_ = NULL;
			GXmlNode* _tmp24_ = NULL;
			GXmlNode* _tmp25_ = NULL;
			GXmlNode* _tmp26_ = NULL;
			gchar* _tmp27_ = NULL;
			gchar* _tmp28_ = NULL;
			gchar* _tmp29_ = NULL;
			gboolean _tmp30_ = FALSE;
			gboolean _tmp31_ = FALSE;
			_tmp12_ = _n_index;
			_n_index = _tmp12_ + 1;
			_tmp13_ = _n_index;
			_tmp14_ = _n_size;
			if (!(_tmp13_ < _tmp14_)) {
				break;
			}
			_tmp15_ = _n_list;
			_tmp16_ = _n_index;
			_tmp17_ = gxml_element_list_get (_tmp15_, _tmp16_);
			n = (GXmlNode*) _tmp17_;
			_tmp18_ = n;
			if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp18_, GXML_TYPE_ELEMENT)) {
				_g_object_unref0 (n);
				continue;
			}
			_tmp19_ = n;
			_tmp20_ = gxml_node_get_attrs (_tmp19_);
			_tmp21_ = _tmp20_;
			_tmp22_ = _tmp21_;
			_tmp23_ = gee_map_get (_tmp22_, "class");
			_tmp24_ = (GXmlNode*) _tmp23_;
			_g_object_unref0 (_tmp22_);
			p = _tmp24_;
			_tmp25_ = p;
			if (_tmp25_ == NULL) {
				_g_object_unref0 (p);
				_g_object_unref0 (n);
				continue;
			}
			_tmp26_ = p;
			_tmp27_ = gxml_node_get_value (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = _tmp28_;
			_tmp30_ = string_contains (_tmp29_, " ");
			_tmp31_ = _tmp30_;
			_g_free0 (_tmp29_);
			if (_tmp31_) {
				GXmlNode* _tmp32_ = NULL;
				gchar* _tmp33_ = NULL;
				gchar* _tmp34_ = NULL;
				gchar* _tmp35_ = NULL;
				gchar** _tmp36_ = NULL;
				gchar** _tmp37_ = NULL;
				gchar** _tmp38_ = NULL;
				gint _tmp38__length1 = 0;
				_tmp32_ = p;
				_tmp33_ = gxml_node_get_value (_tmp32_);
				_tmp34_ = _tmp33_;
				_tmp35_ = _tmp34_;
				_tmp37_ = _tmp36_ = g_strsplit (_tmp35_, " ", 0);
				_tmp38_ = _tmp37_;
				_tmp38__length1 = _vala_array_length (_tmp36_);
				_g_free0 (_tmp35_);
				{
					gchar** ks_collection = NULL;
					gint ks_collection_length1 = 0;
					gint _ks_collection_size_ = 0;
					gint ks_it = 0;
					ks_collection = _tmp38_;
					ks_collection_length1 = _tmp38__length1;
					for (ks_it = 0; ks_it < _tmp38__length1; ks_it = ks_it + 1) {
						gchar* _tmp39_ = NULL;
						gchar* ks = NULL;
						_tmp39_ = g_strdup (ks_collection[ks_it]);
						ks = _tmp39_;
						{
							const gchar* _tmp40_ = NULL;
							const gchar* _tmp41_ = NULL;
							_tmp40_ = ks;
							_tmp41_ = klass;
							if (g_strcmp0 (_tmp40_, _tmp41_) == 0) {
								GXmlElementList* _tmp42_ = NULL;
								GXmlNode* _tmp43_ = NULL;
								_tmp42_ = rl;
								_tmp43_ = n;
								gee_abstract_collection_add ((GeeAbstractCollection*) _tmp42_, G_TYPE_CHECK_INSTANCE_CAST (_tmp43_, GXML_TYPE_ELEMENT, GXmlElement));
							}
							_g_free0 (ks);
						}
					}
					ks_collection = (_vala_array_free (ks_collection, ks_collection_length1, (GDestroyNotify) g_free), NULL);
				}
			} else {
				const gchar* _tmp44_ = NULL;
				GXmlNode* _tmp45_ = NULL;
				gchar* _tmp46_ = NULL;
				gchar* _tmp47_ = NULL;
				gchar* _tmp48_ = NULL;
				gboolean _tmp49_ = FALSE;
				_tmp44_ = klass;
				_tmp45_ = p;
				_tmp46_ = gxml_node_get_value (_tmp45_);
				_tmp47_ = _tmp46_;
				_tmp48_ = _tmp47_;
				_tmp49_ = g_strcmp0 (_tmp44_, _tmp48_) == 0;
				_g_free0 (_tmp48_);
				if (_tmp49_) {
					GXmlElementList* _tmp50_ = NULL;
					GXmlNode* _tmp51_ = NULL;
					_tmp50_ = rl;
					_tmp51_ = n;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp50_, G_TYPE_CHECK_INSTANCE_CAST (_tmp51_, GXML_TYPE_ELEMENT, GXmlElement));
				}
			}
			_g_object_unref0 (p);
			_g_object_unref0 (n);
		}
		_g_object_unref0 (_n_list);
	}
	result = rl;
	_g_object_unref0 (l);
	return result;
}


/**
 * Get first node where 'id' attribute has given value.
 */
GXmlElement* gxml_html_document_get_element_by_id (GXmlHtmlDocument* self, const gchar* id) {
	GXmlElement* result = NULL;
	GXmlElementList* l = NULL;
	GXmlNode* _tmp0_ = NULL;
	GXmlNode* _tmp1_ = NULL;
	GXmlNode* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	GXmlElementList* _tmp4_ = NULL;
	GXmlElementList* _tmp5_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (id != NULL, NULL);
	_tmp0_ = gxml_xdocument_get_root ((GXmlxDocument*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = id;
	_tmp4_ = gxml_node_get_elements_by_property_value (_tmp2_, "id", _tmp3_);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp2_);
	l = _tmp5_;
	{
		GXmlElementList* _n_list = NULL;
		GXmlElementList* _tmp6_ = NULL;
		GXmlElementList* _tmp7_ = NULL;
		gint _n_size = 0;
		GXmlElementList* _tmp8_ = NULL;
		gint _tmp9_ = 0;
		gint _tmp10_ = 0;
		gint _n_index = 0;
		_tmp6_ = l;
		_tmp7_ = _g_object_ref0 (_tmp6_);
		_n_list = _tmp7_;
		_tmp8_ = _n_list;
		_tmp9_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp8_);
		_tmp10_ = _tmp9_;
		_n_size = _tmp10_;
		_n_index = -1;
		while (TRUE) {
			gint _tmp11_ = 0;
			gint _tmp12_ = 0;
			gint _tmp13_ = 0;
			GXmlNode* n = NULL;
			GXmlElementList* _tmp14_ = NULL;
			gint _tmp15_ = 0;
			GXmlElement* _tmp16_ = NULL;
			GXmlNode* _tmp17_ = NULL;
			GXmlNode* p = NULL;
			GXmlNode* _tmp18_ = NULL;
			GeeMap* _tmp19_ = NULL;
			GeeMap* _tmp20_ = NULL;
			GeeMap* _tmp21_ = NULL;
			gpointer _tmp22_ = NULL;
			GXmlNode* _tmp23_ = NULL;
			GXmlNode* _tmp24_ = NULL;
			GXmlNode* _tmp25_ = NULL;
			gchar* _tmp26_ = NULL;
			gchar* _tmp27_ = NULL;
			gchar* _tmp28_ = NULL;
			const gchar* _tmp29_ = NULL;
			gboolean _tmp30_ = FALSE;
			_tmp11_ = _n_index;
			_n_index = _tmp11_ + 1;
			_tmp12_ = _n_index;
			_tmp13_ = _n_size;
			if (!(_tmp12_ < _tmp13_)) {
				break;
			}
			_tmp14_ = _n_list;
			_tmp15_ = _n_index;
			_tmp16_ = gxml_element_list_get (_tmp14_, _tmp15_);
			n = (GXmlNode*) _tmp16_;
			_tmp17_ = n;
			if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, GXML_TYPE_ELEMENT)) {
				_g_object_unref0 (n);
				continue;
			}
			_tmp18_ = n;
			_tmp19_ = gxml_node_get_attrs (_tmp18_);
			_tmp20_ = _tmp19_;
			_tmp21_ = _tmp20_;
			_tmp22_ = gee_map_get (_tmp21_, "id");
			_tmp23_ = (GXmlNode*) _tmp22_;
			_g_object_unref0 (_tmp21_);
			p = _tmp23_;
			_tmp24_ = p;
			if (_tmp24_ == NULL) {
				_g_object_unref0 (p);
				_g_object_unref0 (n);
				continue;
			}
			_tmp25_ = p;
			_tmp26_ = gxml_node_get_value (_tmp25_);
			_tmp27_ = _tmp26_;
			_tmp28_ = _tmp27_;
			_tmp29_ = id;
			_tmp30_ = g_strcmp0 (_tmp28_, _tmp29_) == 0;
			_g_free0 (_tmp28_);
			if (_tmp30_) {
				GXmlNode* _tmp31_ = NULL;
				GXmlElement* _tmp32_ = NULL;
				_tmp31_ = n;
				_tmp32_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, GXML_TYPE_ELEMENT, GXmlElement));
				result = _tmp32_;
				_g_object_unref0 (p);
				_g_object_unref0 (n);
				_g_object_unref0 (_n_list);
				_g_object_unref0 (l);
				return result;
			}
			_g_object_unref0 (p);
			_g_object_unref0 (n);
		}
		_g_object_unref0 (_n_list);
	}
	result = NULL;
	_g_object_unref0 (l);
	return result;
}


GXmlHtmlDocument* gxml_html_document_construct (GType object_type) {
	GXmlHtmlDocument * self = NULL;
	self = (GXmlHtmlDocument*) gxml_xdocument_construct (object_type);
	return self;
}


GXmlHtmlDocument* gxml_html_document_new (void) {
	return gxml_html_document_construct (GXML_TYPE_HTML_DOCUMENT);
}


gint gxml_html_document_get_default_options (void) {
	gint result;
	result = (gint) (((HTML_PARSE_NONET | HTML_PARSE_NOWARNING) | HTML_PARSE_NOERROR) | HTML_PARSE_NOBLANKS);
	return result;
}


static void gxml_html_document_class_init (GXmlHtmlDocumentClass * klass) {
	gxml_html_document_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_html_document_get_property;
}


static void gxml_html_document_instance_init (GXmlHtmlDocument * self) {
}


GType gxml_html_document_get_type (void) {
	static volatile gsize gxml_html_document_type_id__volatile = 0;
	if (g_once_init_enter (&gxml_html_document_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GXmlHtmlDocumentClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_html_document_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlHtmlDocument), 0, (GInstanceInitFunc) gxml_html_document_instance_init, NULL };
		GType gxml_html_document_type_id;
		gxml_html_document_type_id = g_type_register_static (GXML_TYPE_XDOCUMENT, "GXmlHtmlDocument", &g_define_type_info, 0);
		g_once_init_leave (&gxml_html_document_type_id__volatile, gxml_html_document_type_id);
	}
	return gxml_html_document_type_id__volatile;
}


static void _vala_gxml_html_document_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GXmlHtmlDocument * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_HTML_DOCUMENT, GXmlHtmlDocument);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}


static gint _vala_array_length (gpointer array) {
	int length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}



