GXmlGomElementAttributes

GXmlGomElementAttributes — Holds attributes in current node, using attribute's name as key and it's value as value. Appends namespace prefix to attribute's name as key if a namespaced attribute.

Functions

Types and Values

Description

Functions

gxml_gom_element_read_from_uri ()

void
gxml_gom_element_read_from_uri (GXmlGomElement *self,
                                const gchar *uri,
                                GError **error);

Parsing a URI file.

Parameters

self

the GXmlGomElement instance

 

uri

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_gom_element_read_from_file ()

void
gxml_gom_element_read_from_file (GXmlGomElement *self,
                                 GFile *f,
                                 GCancellable *cancellable,
                                 GError **error);

Parses an XML file, deserializing it over gxml_gom_element_new().

Parameters

self

the GXmlGomElement instance

 

f

 

 

cancellable

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_gom_element_read_from_stream ()

void
gxml_gom_element_read_from_stream (GXmlGomElement *self,
                                   GInputStream *istream,
                                   GCancellable *cancellable,
                                   GError **error);

Parses an XML over a GInputStream, deserializing it over gxml_gom_element_new().

Parameters

self

the GXmlGomElement instance

 

istream

 

 

cancellable

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_gom_element_read_from_string ()

void
gxml_gom_element_read_from_string (GXmlGomElement *self,
                                   const gchar *str,
                                   GError **error);

Parses an XML string, deserializing it over gxml_gom_element_new().

Parameters

self

the GXmlGomElement instance

 

str

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_gom_element_write_string ()

gchar *
gxml_gom_element_write_string (GXmlGomElement *self,
                               GError **error);

Serialize gxml_gom_element_new() to a string.

Parameters

self

the GXmlGomElement instance

 

error

location to store the error occuring, or NULL to ignore

 

gxml_gom_element_write_file ()

void
gxml_gom_element_write_file (GXmlGomElement *self,
                             GFile *f,
                             GError **error);

Uses element's GXmlGomDocument to write an XML to a file, serializing it.

Parameters

self

the GXmlGomElement instance

 

f

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_gom_element_write_stream ()

void
gxml_gom_element_write_stream (GXmlGomElement *self,
                               GOutputStream *stream,
                               GError **error);

Uses element's GXmlGomDocument to write an XML to a stream, serializing it.

Parameters

self

the GXmlGomElement instance

 

stream

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_gom_element_lookup_prefix ()

gchar *
gxml_gom_element_lookup_prefix (GXmlGomElement *self,
                                const gchar *nspace);

Parameters

self

the GXmlGomElement instance

 

nspace

 

 

gxml_gom_element_lookup_namespace_uri ()

gchar *
gxml_gom_element_lookup_namespace_uri (GXmlGomElement *self,
                                       const gchar *prefix);

Parameters

self

the GXmlGomElement instance

 

prefix

 

 

gxml_gom_element_initialize ()

void
gxml_gom_element_initialize (GXmlGomElement *self,
                             const gchar *local_name);

Convenient function to initialize, at construction time, a gxml_gom_element_new() using given local name. If gxml_gom_element_initialize_with_namespace() has been called in any base class, this method just change elment node's name and keeps previous namespace and prefix.

No GXmlDomDocument is set by default, if this is a top level element in a document, you can call "owner-document" to set one if not set already.

Any instance properties of type gxml_gom_element_new() or GXmlGomCollection should be initialized using gxml_gom_object_set_instance_property()

Parameters

self

the GXmlGomElement instance

 

local_name

 

 

gxml_gom_element_initialize_document ()

void
gxml_gom_element_initialize_document (GXmlGomElement *self,
                                      GXmlDomDocument *doc,
                                      const gchar *local_name);

Convenient function to initialize, at construction time, a gxml_gom_element_new() using given local name and document.

Parameters

self

the GXmlGomElement instance

 

doc

 

 

local_name

 

 

gxml_gom_element_initialize_with_namespace ()

void
gxml_gom_element_initialize_with_namespace
                               (GXmlGomElement *self,
                                const gchar *namespace_uri,
                                const gchar *prefix,
                                const gchar *local_name);

Convenient function to initialize, at construction time, a gxml_gom_element_new() using given local name and namespace.

Parameters

self

the GXmlGomElement instance

 

namespace_uri

 

 

prefix

 

 

local_name

 

 

gxml_gom_element_initialize_document_with_namespace ()

void
gxml_gom_element_initialize_document_with_namespace
                               (GXmlGomElement *self,
                                GXmlDomDocument *doc,
                                const gchar *namespace_uri,
                                const gchar *prefix,
                                const gchar *local_name);

Convenient function to initialize, at construction time, a gxml_gom_element_new() using given local name, document and namespace.

Parameters

self

the GXmlGomElement instance

 

doc

 

 

namespace_uri

 

 

prefix

 

 

local_name

 

 

gxml_gom_element_attributes_new ()

GXmlGomElementAttributes *
gxml_gom_element_attributes_new (GXmlGomElement *element);

Parameters

element

 

 

gxml_gom_element_new ()

GXmlGomElement *
gxml_gom_element_new (void);

Types and Values

GXML_TYPE_GOM_ELEMENT

#define GXML_TYPE_GOM_ELEMENT (gxml_gom_element_get_type ())

The type for GXmlGomElement.


GXML_GOM_ELEMENT_TYPE_ATTRIBUTES

#define GXML_GOM_ELEMENT_TYPE_ATTRIBUTES (gxml_gom_element_attributes_get_type ())

The type for GXmlGomElementAttributes.


struct GXmlGomElementAttributes

struct GXmlGomElementAttributes {
	GeeHashMap parent_instance;
	GXmlGomElementAttributesPrivate * priv;
	GXmlGomElement* _element;
};

Holds attributes in current node, using attribute's name as key and it's value as value. Appends namespace prefix to attribute's name as key if a namespaced attribute.

Members

GXmlGomElementAttributesPrivate *priv;

   

GXmlGomElement *_element;

Holds gxml_gom_element_new() refrence to attributes' parent element. Derived classes should not modify, but set at construction time.

 

struct GXmlGomElementAttributesClass

struct GXmlGomElementAttributesClass {
	GeeHashMapClass parent_class;
};

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

Members


struct GXmlGomElement

struct GXmlGomElement {
	GXmlGomNode parent_instance;
	GXmlGomElementPrivate * priv;
	GXmlGomElementAttributes* _attributes;
	gchar* _namespace_uri;
};

A GXml Object Model (GOM) implementation of gxml_gom_element_new().It can be used transparently as GXmlDomElement in a XML tree.

Members

GXmlGomElementPrivate *priv;

   

GXmlGomElementAttributes *_attributes;

Reference to GXmlGomElementAttributes for element's attributes. Derived classes should avoid to modify it.

 

gchar *_namespace_uri;

Use this field to set node's namespace URI. Can used to set it at construction time.

 

struct GXmlGomElementClass

struct GXmlGomElementClass {
	GXmlGomNodeClass parent_class;
};

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

Members