GXmlElementList

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

Functions

Types and Values

Description

Functions

gxml_element_list_new ()

GXmlElementList *
gxml_element_list_new (void);

gxml_element_normalize ()

void
gxml_element_normalize (GXmlElement *self);

This merges all adjacent GXmlText nodes that are descendants of this GXmlElement.

Parameters

self

the GXmlElement instance

 

gxml_element_set_attr ()

void
gxml_element_set_attr (GXmlElement *self,
                       const gchar *name,
                       const gchar *value);

Add a new GXmlAttribute to this GXmlElement.

You should provide a name and a value.

Parameters

self

the GXmlElement instance

 

name

 

 

value

 

 

gxml_element_get_attr ()

GXmlNode *
gxml_element_get_attr (GXmlElement *self,
                       const gchar *name);

Search for a GXmlAttribute with given name.

All attributes could be get using "attrs" property.

Parameters

self

the GXmlElement instance

 

name

 

 

gxml_element_remove_attr ()

void
gxml_element_remove_attr (GXmlElement *self,
                          const gchar *name);

Search for a GXmlAttribute with given name and removes it.

Parameters

self

the GXmlElement instance

 

name

 

 

gxml_element_remove_ns_attr ()

void
gxml_element_remove_ns_attr (GXmlElement *self,
                             const gchar *name,
                             const gchar *uri);

Search for a GXmlAttribute with given name and namespace and removes it.

Parameters

self

the GXmlElement instance

 

name

 

 

uri

 

 

gxml_element_set_ns_attr ()

void
gxml_element_set_ns_attr (GXmlElement *self,
                          const gchar *ns,
                          const gchar *name,
                          const gchar *value);

Set an GXmlAttribute with a given name, value and namespace.

Parameters

self

the GXmlElement instance

 

ns

 

 

name

 

 

value

 

 

gxml_element_get_ns_attr ()

GXmlNode *
gxml_element_get_ns_attr (GXmlElement *self,
                          const gchar *name,
                          const gchar *uri);

Search for a GXmlAttribute with a given name and namespace uri.

To get a attibute from "attrs" with a given namespace prefix, use "prefix:name".

Parameters

self

the GXmlElement instance

 

name

 

 

uri

 

 

gxml_element_get_tag_name ()

gchar *
gxml_element_get_tag_name (GXmlElement *self);

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

This should be just a different name for "name".

Parameters

self

the GXmlElement instance to query

 

Returns

the value of the "tag-name" property


gxml_element_get_content ()

gchar *
gxml_element_get_content (GXmlElement *self);

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

This should be just a different name for "value".

Parameters

self

the GXmlElement instance to query

 

Returns

the value of the "content" property


gxml_element_set_content ()

void
gxml_element_set_content (GXmlElement *self,
                          const gchar *value);

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

This should be just a different name for "value".

Parameters

self

the GXmlElement instance to modify

 

value

the new value of the "content" property

 

Types and Values

GXML_TYPE_ELEMENT_LIST

#define GXML_TYPE_ELEMENT_LIST (gxml_element_list_get_type ())

The type for GXmlElementList.


struct GXmlElementList

struct GXmlElementList {
	GeeArrayList parent_instance;
	GXmlElementListPrivate * priv;
};

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


struct GXmlElementListClass

struct GXmlElementListClass {
	GeeArrayListClass parent_class;
};

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

Members


GXmlElement

typedef struct _GXmlElement GXmlElement;

Interface to access XML document's tags, properties and content.

Provides methods to create new XML tags properties and its values, and access to tag's contents.


struct GXmlElementIface

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 (*remove_ns_attr) (GXmlElement* self, const gchar* name, const gchar* uri);
	void (*set_ns_attr) (GXmlElement* self, const gchar* 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);
};

Interface for creating GXmlElement implementations.

Members

GTypeInterface parent_iface;

the parent interface structure

 

normalize ()

virtual method called by gxml_element_normalize()

 

set_attr ()

virtual method called by gxml_element_set_attr()

 

get_attr ()

virtual method called by gxml_element_get_attr()

 

remove_attr ()

virtual method called by gxml_element_remove_attr()

 

remove_ns_attr ()

virtual method called by gxml_element_remove_ns_attr()

 

set_ns_attr ()

virtual method called by gxml_element_set_ns_attr()

 

get_ns_attr ()

virtual method called by gxml_element_get_ns_attr()

 

get_tag_name ()

getter method for the abstract property "tag-name"

 

get_content ()

getter method for the abstract property "content"

 

set_content ()

setter method for the abstract property "content"