ibusxml

## ibusxml ibusxml — XML handling functions for IBus. |

## Stability Level

Stable, unless otherwise indicated

## Synopsis

                        XMLNode;
    void                ibus_xml_free                       (XMLNode *node);
    void                ibus_xml_output                     (const XMLNode *node,
                                                             GString *output);
    XMLNode *           ibus_xml_parse_buffer               (const gchar *buffer);
    XMLNode *           ibus_xml_parse_file                 (const gchar *name);

## Description

IBusXML lists data structure and handling function for XML in IBus.

## Details

### XMLNode

    typedef struct {
        gchar  *name;
        gchar  *text;
        gchar  **attributes;
        GList *sub_nodes;
    } XMLNode;

A data type representing an XML nod.

gchar *`name`; | Name of XML tag.
gchar *`text`; | Text enclosed by XML start tag and end tag. i.e. `text`.
gchar **`attributes`; | Attributes of the XML node.
GList *`sub_nodes`; | Children node of this XML node.

### ibus_xml_free ()

    void                ibus_xml_free                       (XMLNode *node);

Free an XML tree.

`node` : | Root node of an XML tree.

### ibus_xml_output ()

    void                ibus_xml_output                     (const XMLNode *node,
                                                             GString *output);

Output an XML tree to a GString.

`node` : | Root node of an XML tree.
`output` : | GString which stores the output.

### ibus_xml_parse_buffer ()

    XMLNode *           ibus_xml_parse_buffer               (const gchar *buffer);

Parse a string buffer which contains an XML-formatted string, and return a corresponding XML tree.

`buffer` : | Buffer to be parsed.
Returns : | Root node of parsed XML tree.

### ibus_xml_parse_file ()

    XMLNode *           ibus_xml_parse_file                 (const gchar *name);

Parse an XML file and return a corresponding XML tree.

`name` : | File name to be parsed.
Returns : | Root node of parsed XML tree.