RmXml

RmXml — XML parsing functions

Stability Level

Stable, unless otherwise indicated

Functions

Types and Values

Description

Small subset of function for parsing and modifying XML files.

Functions

rm_xmlnode_new ()

RmXmlNode *
rm_xmlnode_new (const gchar *name);

Create a new tag node

Parameters

name

node name

 

Returns

a new RmXmlNode or NULL on error


rm_xmlnode_new_child ()

RmXmlNode *
rm_xmlnode_new_child (RmXmlNode *parent,
                      const gchar *name);

Create new child node.

Parameters

parent

a RmXmlNode

 

name

node name

 

Returns

new node pointer or NULL on error


rm_xml_read_from_file ()

RmXmlNode *
rm_xml_read_from_file (const gchar *file_name);

Read xml from file.

Parameters

file_name

xml file name

 

Returns

new RmXmlNode or NULL


rm_xmlnode_get_child ()

RmXmlNode *
rm_xmlnode_get_child (const RmXmlNode *parent,
                      const gchar *name);

Get xml node child

Parameters

parent

xml node parent

 

name

child name

 

Returns

child RmXmlNode


rm_xmlnode_get_next_twin ()

RmXmlNode *
rm_xmlnode_get_next_twin (RmXmlNode *node);

Get next twin from xml node

Parameters

node

xml node

 

Returns

next RmXmlNode twin


rm_xmlnode_get_data ()

gchar *
rm_xmlnode_get_data (RmXmlNode *node);

Get data from RmXmlNode

Parameters

node

a RmXmlNode

 

Returns

RmXmlNode data


rm_xmlnode_get_attrib ()

const gchar *
rm_xmlnode_get_attrib (RmXmlNode *node,
                       const gchar *attr);

Get attribute from node

Parameters

node

a RmXmlNode

 

attr

attribute name

 

Returns

attribute data


rm_xmlnode_from_str ()

RmXmlNode *
rm_xmlnode_from_str (const char *str,
                     gssize size);

Create RmXmlNode from string

Parameters

str

string

 

size

size of string

 

Returns

new RmXmlNode


rm_xmlnode_insert_data ()

void
rm_xmlnode_insert_data (RmXmlNode *node,
                        const gchar *data,
                        gssize size);

Insert data into RmXmlNode

Parameters

node

a RmXmlNode

 

data

data pointer

 

size

size of data

 

rm_xmlnode_free ()

void
rm_xmlnode_free (RmXmlNode *node);

Free node

Parameters

node

a RmXmlNode

 

rm_xmlnode_set_attrib ()

void
rm_xmlnode_set_attrib (RmXmlNode *node,
                       const gchar *attr,
                       const gchar *value);

Set attribute for node

Parameters

node

a RmXmlNode

 

attr

attribute name

 

value

value to set

 

rm_xmlnode_insert_child ()

void
rm_xmlnode_insert_child (RmXmlNode *parent,
                         RmXmlNode *child);

Insert child into parent node

Parameters

parent

a RmXmlNode

 

child

a RmXmlNode

 

rm_xmlnode_to_formatted_str ()

gchar *
rm_xmlnode_to_formatted_str (RmXmlNode *node,
                             gint *len);

Convet node to formatted string

Parameters

node

a RmXmlNode

 

len

pointer to len

 

Returns

formatted string or NULL on error


rm_xmlnode_copy ()

RmXmlNode *
rm_xmlnode_copy (const RmXmlNode *node);

Make a copy of a given node RmXmlNode

Parameters

node

source RmXmlNode

 

Returns

new RmXmlNode

Types and Values

enum RmXmlNodeType

The RmXmlNodeType contains only private fileds and should not be directly accessed.

Members


RmXmlNode

typedef struct {
} RmXmlNode;

The RmXmlNode contains only private fileds and should not be directly accessed.