GXmlNodeList

GXmlNodeList — Convenient class for a list of GXmlNode objects based on Gee.ListArray, with good support for bindings.

Functions

Types and Values

Description

Functions

gxml_node_list_get ()

GXmlNode *
gxml_node_list_get (GXmlNodeList *self,
                    gint index);

Parameters

self

the GXmlNodeList instance

 

index

 

 

gxml_node_list_to_array ()

GXmlNode **
gxml_node_list_to_array (GXmlNodeList *self,
                         int *result_length1);

Parameters

self

the GXmlNodeList instance

 

Returns

.

[array length=result_length1]


gxml_node_list_new ()

GXmlNodeList *
gxml_node_list_new (void);

gxml_node_get ()

GXmlNode *
gxml_node_get (GXmlNode *self,
               const gchar *key);

Get first child with given name, or null.

Parameters

self

the GXmlNode instance

 

key

 

 

gxml_node_get_elements_by_property_value ()

GXmlElementList *
gxml_node_get_elements_by_property_value
                               (GXmlNode *self,
                                const gchar *property,
                                const gchar *value);

Search all child GXmlElement with a given property's name and with value contained in text.

Parameters

self

the GXmlNode instance

 

property

 

 

value

 

 

gxml_node_get_elements_by_name ()

GXmlElementList *
gxml_node_get_elements_by_name (GXmlNode *self,
                                const gchar *name);

Search all child GXmlElement with a given name.

Parameters

self

the GXmlNode instance

 

name

 

 

gxml_node_get_elements_by_name_ns ()

GXmlElementList *
gxml_node_get_elements_by_name_ns (GXmlNode *self,
                                   const gchar *name,
                                   const gchar *ns);

Search all child GXmlElement with a given name and namespace URI.

Parameters

self

the GXmlNode instance

 

name

 

 

ns

 

 

gxml_node_to_string ()

gchar *
gxml_node_to_string (GXmlNode *self);

Node's string representation.

Parameters

self

the GXmlNode instance

 

gxml_node_set_namespace ()

gboolean
gxml_node_set_namespace (GXmlNode *self,
                         const gchar *uri,
                         const gchar *prefix);

Set a namespace to this node.

Search for existing document's namespaces and applies it if found or creates a new one, appending to document's namespaces collection.

Parameters

self

the GXmlNode instance

 

uri

 

 

prefix

 

 

gxml_node_ns_prefix ()

gchar *
gxml_node_ns_prefix (GXmlNode *self);

Node's defaults namespace's prefix.

This allways returns first GXmlNamespace's prefix in GXmlNode's namespaces collection.

Parameters

self

the GXmlNode instance

 

gxml_node_ns_uri ()

gchar *
gxml_node_ns_uri (GXmlNode *self);

Node's defaults namespace's URI.

This allways returns first GXmlNamespace's URI in GXmlNode's namespaces collection.

Parameters

self

the GXmlNode instance

 

gxml_node_get_namespaces ()

GeeList *
gxml_node_get_namespaces (GXmlNode *self);

Get and return the current value of the "namespaces" property.

Collection of Namespaces applied to this GXmlNode.

Parameters

self

the GXmlNode instance to query

 

Returns

the value of the "namespaces" property


gxml_node_get_children_nodes ()

GeeBidirList *
gxml_node_get_children_nodes (GXmlNode *self);

Get and return the current value of the "children-nodes" property.

Collection of GXmlNode as children.

Depends on GXmlNode type, this children could be different, like, elements, element's contents or properties.

Parameters

self

the GXmlNode instance to query

 

Returns

the value of the "children-nodes" property


gxml_node_get_attrs ()

GeeMap *
gxml_node_get_attrs (GXmlNode *self);

Get and return the current value of the "attrs" property.

Attributes in this GXmlNode.

Parameters

self

the GXmlNode instance to query

 

Returns

the value of the "attrs" property


gxml_node_get_name ()

gchar *
gxml_node_get_name (GXmlNode *self);

Get and return the current value of the "name" property.

Node's name. The meaning differs, depending on node's type.

Parameters

self

the GXmlNode instance to query

 

Returns

the value of the "name" property


gxml_node_get_value ()

gchar *
gxml_node_get_value (GXmlNode *self);

Get and return the current value of the "value" property.

Node's value. The meaning differs, depending on node's type.

Parameters

self

the GXmlNode instance to query

 

Returns

the value of the "value" property


gxml_node_set_value ()

void
gxml_node_set_value (GXmlNode *self,
                     const gchar *value);

Set the value of the "value" property to value .

Node's value. The meaning differs, depending on node's type.

Parameters

self

the GXmlNode instance to modify

 

value

the new value of the "value" property

 

gxml_node_get_type_node ()

GXmlNodeType
gxml_node_get_type_node (GXmlNode *self);

Get and return the current value of the "type-node" property.

Node's type as a enumeration.

Parameters

self

the GXmlNode instance to query

 

Returns

the value of the "type-node" property


gxml_node_get_document ()

GXmlDocument *
gxml_node_get_document (GXmlNode *self);

Get and return the current value of the "document" property.

Node's XML document holding this node.

Parameters

self

the GXmlNode instance to query

 

Returns

the value of the "document" property


gxml_node_get_parent ()

GXmlNode *
gxml_node_get_parent (GXmlNode *self);

Get and return the current value of the "parent" property.

Node's XML document holding this node.

Parameters

self

the GXmlNode instance to query

 

Returns

the value of the "parent" property


gxml_node_copy ()

gboolean
gxml_node_copy (GXmlDocument *doc,
                GXmlNode *node,
                GXmlNode *source,
                gboolean deep);

Copy a GXmlNode relaying on GXmlDocument to other GXmlNode.

node could belongs from different GXmlDocument, while source is a node belonging to given document.

Only GXmlElement objects are supported. For attributes, use gxml_element_set_attr() method, passing source's name and value as arguments.

Parameters

doc

 .

a GXmlDocument owning destiny node

.

[in]

node

 .

a GXmlElement to copy nodes to

.

[in]

source

 .

a GXmlElement to copy nodes from, it could be holded by different GXmlDocument

.

[in]

deep

 

 

Types and Values

GXML_TYPE_NODE_LIST

#define GXML_TYPE_NODE_LIST (gxml_node_list_get_type ())

The type for GXmlNodeList.


struct GXmlNodeList

struct GXmlNodeList {
	GeeArrayList parent_instance;
	GXmlNodeListPrivate * priv;
};

Convenient class for a list of GXmlNode objects based on Gee.ListArray, with good support for bindings.


struct GXmlNodeListClass

struct GXmlNodeListClass {
	GeeArrayListClass parent_class;
};

The class structure for GXML_TYPE_NODE_LIST. All the fields in this structure are private and should never be accessed directly.

Members


GXmlNode

typedef struct _GXmlNode GXmlNode;

Base interface providing basic functionalities to all GXml interfaces.


struct GXmlNodeIface

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);
	GXmlElementList* (*get_elements_by_name) (GXmlNode* self, const gchar* name);
	GXmlElementList* (*get_elements_by_name_ns) (GXmlNode* self, const gchar* name, const gchar* ns);
	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_children_nodes) (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);
};

Interface for creating GXmlNode implementations.

Members

GTypeInterface parent_iface;

the parent interface structure

 

get ()

   

get_elements_by_property_value ()

virtual method called by gxml_node_get_elements_by_property_value()

 

get_elements_by_name ()

virtual method called by gxml_node_get_elements_by_name()

 

get_elements_by_name_ns ()

virtual method called by gxml_node_get_elements_by_name_ns()

 

to_string ()

virtual method called by gxml_node_to_string()

 

set_namespace ()

virtual method called by gxml_node_set_namespace()

 

ns_prefix ()

virtual method called by gxml_node_ns_prefix()

 

ns_uri ()

virtual method called by gxml_node_ns_uri()

 

get_namespaces ()

getter method for the abstract property "namespaces"

 

get_children_nodes ()

getter method for the abstract property "children-nodes"

 

get_attrs ()

getter method for the abstract property "attrs"

 

get_name ()

getter method for the abstract property "name"

 

get_value ()

getter method for the abstract property "value"

 

set_value ()

setter method for the abstract property "value"

 

get_type_node ()

getter method for the abstract property "type-node"

 

get_document ()

getter method for the abstract property "document"

 

get_parent ()

getter method for the abstract property "parent"