as-xml 3 APPSTREAM Library
as-xml Helper functions to parse AppStream XML data

## Functions

gchar * | as_xml_get_node_value ()
gchar * | as_xmldata_get_node_locale ()
void | as_xml_add_children_values_to_array ()
GPtrArray * | as_xml_get_children_as_string_list ()
gchar ** | as_xml_get_children_as_strv ()
void | as_xml_parse_metainfo_description_node ()
gchar * | as_xml_dump_node_children ()
void | as_xml_add_description_node ()
void | as_xml_add_localized_text_node ()
xmlNode * | as_xml_add_node_list_strv ()
void | as_xml_add_node_list ()
xmlNode * | as_xml_add_text_node ()
xmlDoc * | as_xml_parse_document ()
gchar * | as_xml_node_to_str ()

## Includes

    #include <appstream.h>

## Description

## Functions

### as_xml_get_node_value ()

    gchar *
    as_xml_get_node_value (xmlNode *node);

as_xml_get_node_value

### as_xmldata_get_node_locale ()

    gchar *
    as_xmldata_get_node_locale (AsContext *ctx,
                                xmlNode *node);

#### Parameters

node | A XML node |

#### Returns

The locale of a node, if the node should be considered for inclusion. `NULL` if the node should be ignored due to a not-matching locale.

as_xmldata_get_node_locale

### as_xml_add_children_values_to_array ()

    void
    as_xml_add_children_values_to_array (xmlNode *node,
                                         const gchar *element_name,
                                         GPtrArray *array);

as_xml_add_children_values_to_array

### as_xml_get_children_as_string_list ()

    GPtrArray *
    as_xml_get_children_as_string_list (xmlNode *node,
                                        const gchar *element_name);

as_xml_get_children_as_string_list

### as_xml_get_children_as_strv ()

    gchar **
    as_xml_get_children_as_strv (xmlNode *node,
                                 const gchar *element_name);

as_xml_get_children_as_strv

### as_xml_parse_metainfo_description_node ()

    void
    as_xml_parse_metainfo_description_node
                                   (AsContext *ctx,
                                    xmlNode *node,
                                    GHFunc func,
                                    gpointer entity);

as_xml_parse_metainfo_description_node

### as_xml_dump_node_children ()

    gchar *
    as_xml_dump_node_children (xmlNode *node);

as_xml_dump_node_children

### as_xml_add_description_node ()

    void
    as_xml_add_description_node (AsContext *ctx,
                                 xmlNode *root,
                                 GHashTable *desc_table);

Add a description node to the XML document tree.

as_xml_add_description_node

### as_xml_add_localized_text_node ()

    void
    as_xml_add_localized_text_node (xmlNode *root,
                                    const gchar *node_name,
                                    GHashTable *value_table);

Add set of localized XML nodes based on a localization table.

as_xml_add_localized_text_node

### as_xml_add_node_list_strv ()

    xmlNode *
    as_xml_add_node_list_strv (xmlNode *root,
                               const gchar *name,
                               const gchar *child_name,
                               gchar **strv);

Add node with a list of children containing the strv contents.

as_xml_add_node_list_strv

### as_xml_add_node_list ()

    void
    as_xml_add_node_list (xmlNode *root,
                          const gchar *name,
                          const gchar *child_name,
                          GPtrArray *array);

Add node with a list of children containing the string array contents.

as_xml_add_node_list

### as_xml_add_text_node ()

    xmlNode *
    as_xml_add_text_node (xmlNode *root,
                          const gchar *name,
                          const gchar *value);

Add node if value is not empty

as_xml_add_text_node

### as_xml_parse_document ()

    xmlDoc *
    as_xml_parse_document (const gchar *data,
                           GError **error);

as_xml_parse_document

### as_xml_node_to_str ()

    gchar *
    as_xml_node_to_str (xmlNode *root,
                        GError **error);

Converts an XML node into its textural representation.

#### Returns

XML metadata.

as_xml_node_to_str

## Types and Values