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

## Stability Level

Stable, unless otherwise indicated

## Functions

XMLNode * | ibus_xml_parse_file ()
XMLNode * | ibus_xml_parse_buffer ()
void | ibus_xml_free ()
void | ibus_xml_output ()

## Types and Values

| XMLNode

## Description

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

## Functions

### ibus_xml_parse_file ()

    XMLNode *
    ibus_xml_parse_file (const gchar *name);

Parse an XML file and return a corresponding XML tree.

#### Parameters

name | File name to be parsed. |

#### Returns

Root node of parsed XML tree.

### 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.

#### Parameters

buffer | Buffer to be parsed. |

#### Returns

Root node of parsed XML tree.

### ibus_xml_free ()

    void
    ibus_xml_free (XMLNode *node);

Free an XML tree.

#### Parameters

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.

#### Parameters

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

## Types and Values

### XMLNode

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

A data type representing an XML nod.

#### Members

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. |