| Top |  |  |  |  | 
| GNode * | as_node_new () | 
| GQuark | as_node_error_quark () | 
| void | as_node_unref () | 
| const gchar * | as_node_get_name () | 
| const gchar * | as_node_get_data () | 
| const gchar * | as_node_get_comment () | 
| AsTag | as_node_get_tag () | 
| const gchar * | as_node_get_attribute () | 
| gint | as_node_get_attribute_as_int () | 
| guint | as_node_get_attribute_as_uint () | 
| GHashTable * | as_node_get_localized () | 
| const gchar * | as_node_get_localized_best () | 
| GHashTable * | as_node_get_localized_unwrap () | 
| void | as_node_set_name () | 
| void | as_node_set_data () | 
| void | as_node_set_comment () | 
| void | as_node_add_attribute () | 
| void | as_node_add_attribute_as_int () | 
| void | as_node_add_attribute_as_uint () | 
| void | as_node_remove_attribute () | 
| GString * | as_node_to_xml () | 
| GNode * | as_node_from_xml () | 
| GNode * | as_node_from_bytes () | 
| GNode * | as_node_from_file () | 
| gboolean | as_node_to_file () | 
| GNode * | as_node_find () | 
| GNode * | as_node_find_with_attribute () | 
| GNode * | as_node_insert () | 
| void | as_node_insert_localized () | 
| void | as_node_insert_hash () | 
| enum | AsNodeToXmlFlags | 
| enum | AsNodeFromXmlFlags | 
| enum | AsNodeInsertFlags | 
| enum | AsNodeError | 
| #define | AS_NODE_ERROR | 
| typedef | AsNode | 
These helper functions allow parsing to and from AsApp's and the AppStream XML representation. This parser is UTF-8 safe, but not very fast, and parsers like expat should be used if full XML specification adherence is required.
See also: AsApp
GNode *
as_node_new (void);
Creates a new empty tree whicah can have nodes appended to it.
[skip]
Since: 0.1.0
const gchar *
as_node_get_name (const GNode *node);
Gets the node name, e.g. "body"
Since: 0.1.0
const gchar *
as_node_get_data (const GNode *node);
Gets the node data, e.g. "paragraph text"
Since: 0.1.0
const gchar *
as_node_get_comment (const GNode *node);
Gets the node data, e.g. "Copyright 2014 Richard Hughes"
Since: 0.1.6
const gchar * as_node_get_attribute (const GNode *node,const gchar *key);
Gets a node attribute, e.g. "false"
Since: 0.1.0
gint as_node_get_attribute_as_int (const GNode *node,const gchar *key);
Gets a node attribute, e.g. 34
Since: 0.1.0
guint as_node_get_attribute_as_uint (const GNode *node,const gchar *key);
Gets a node attribute, e.g. 34
Since: 0.6.1
GHashTable * as_node_get_localized (const GNode *node,const gchar *key);
Extracts localized values from the DOM tree
Since: 0.1.0
const gchar * as_node_get_localized_best (const GNode *node,const gchar *key);
Gets the 'best' locale version of a specific data value.
Since: 0.1.0
GHashTable * as_node_get_localized_unwrap (const GNode *node,GError **error);
Denormalize AppData data like this:
| 1 2 3 4 5 6 7 8 | <description> <p>Hi</p> <p xml:lang="pl">Czesc</p> <ul> <li>First</li> <li xml:lang="pl">Pierwszy</li> </ul> </description> | 
into a hash that contains:
| 1 2 | "C" -> "<p>Hi</p><ul><li>First</li></ul>" "pl" -> "<p>Czesc</p><ul><li>Pierwszy</li></ul>" | 
Since: 0.1.0
void as_node_set_name (GNode *node,const gchar *name);
Sets the node name, e.g. "body"
[skip]
Since: 0.1.4
void as_node_set_data (GNode *node,const gchar *cdata,AsNodeInsertFlags insert_flags);
Sets new data on a node.
[skip]
Since: 0.1.1
void as_node_set_comment (GNode *node,const gchar *comment);
Sets new comment for the node.
[skip]
Since: 0.1.6
void as_node_add_attribute (GNode *node,const gchar *key,const gchar *value);
Adds a new attribute to a node.
[skip]
Since: 0.1.1
void as_node_add_attribute_as_int (GNode *node,const gchar *key,gint value);
Adds a new attribute to a node.
[skip]
Since: 0.3.1
void as_node_add_attribute_as_uint (GNode *node,const gchar *key,guint value);
Adds a new attribute to a node.
[skip]
Since: 0.6.1
void as_node_remove_attribute (GNode *node,const gchar *key);
Removes a node attribute, e.g. "type"
[skip]
Since: 0.2.0
GString * as_node_to_xml (const GNode *node,AsNodeToXmlFlags flags);
Converts a node and it's children to XML.
Since: 0.1.0
GNode * as_node_from_xml (const gchar *data,AsNodeFromXmlFlags flags,GError **error);
Parses XML data into a DOM tree.
[skip]
Since: 0.1.0
GNode * as_node_from_bytes (GBytes *bytes,AsNodeFromXmlFlags flags,GError **error);
Parses XML data into a DOM tree.
[skip]
Since: 0.7.6
GNode * as_node_from_file (GFile *file,AsNodeFromXmlFlags flags,GCancellable *cancellable,GError **error);
Parses an XML file into a DOM tree.
[skip]
Since: 0.1.0
gboolean as_node_to_file (const GNode *root,GFile *file,AsNodeToXmlFlags flags,GCancellable *cancellable,GError **error);
Exports a DOM tree to an XML file.
[skip]
| root | A populated AsNode tree | |
| file | a GFile | |
| flags | ||
| cancellable | A GCancellable, or  | |
| error | 
Since: 0.2.0
GNode * as_node_find (GNode *root,const gchar *path);
Gets a node from the DOM tree.
[skip]
Since: 0.1.0
GNode * as_node_find_with_attribute (GNode *root,const gchar *path,const gchar *attr_key,const gchar *attr_value);
Gets a node from the DOM tree with a specified attribute.
[skip]
| root | a root node, or  | |
| path | a path in the DOM, e.g. "html/body" | |
| attr_key | the attribute key | |
| attr_value | the attribute value | 
Since: 0.1.0
GNode * as_node_insert (GNode *parent,const gchar *name,const gchar *cdata,AsNodeInsertFlags insert_flags,...);
Inserts a node into the DOM.
[skip]
| parent | a parent AsNode. | |
| name | the tag name, e.g. "id". | |
| cdata | the tag data, or  | |
| insert_flags | any  | |
| ... | any attributes to add to the node, terminated by  | 
Since: 0.1.0
void as_node_insert_localized (GNode *parent,const gchar *name,GHashTable *localized,AsNodeInsertFlags insert_flags);
Inserts a localized key into the DOM.
| parent | a parent AsNode. | |
| name | the tag name, e.g. "id". | |
| localized | the hash table of data, with the locale as the key. | |
| insert_flags | any  | 
Since: 0.1.0
void as_node_insert_hash (GNode *parent,const gchar *name,const gchar *attr_key,GHashTable *hash,AsNodeInsertFlags insert_flags);
Inserts a hash table of data into the DOM.
| parent | a parent AsNode. | |
| name | the tag name, e.g. "id". | |
| attr_key | the key to use as the attribute in the XML, e.g. "key". | |
| hash | the hash table with the key as the key to use in the XML. | |
| insert_flags | any  | 
Since: 0.1.0
The flags for converting to XML.
The flags to use when inserting a node.