e-xml-utils

e-xml-utils

Functions

Description

Functions

e_xml_parse_file ()

xmlDocPtr
e_xml_parse_file (const gchar *filename);

Reads a local XML file and parses the contents into an XML document structure. If the XML file cannot be read or its contents are malformed, the function returns NULL.

Parameters

filename

path to an XML file

 

Returns

an XML document structure, or NULL


e_xml_save_file ()

gint
e_xml_save_file (const gchar *filename,
                 xmlDocPtr doc);

Writes the given XML document structure to the file given by filename . If an error occurs while saving, the function returns -1 and sets errno.

Parameters

filename

path to a file to save to

 

doc

an XML document structure

 

Returns

0 on success, -1 on failure


e_xml_get_child_by_name ()

xmlNode *
e_xml_get_child_by_name (const xmlNode *parent,
                         const xmlChar *child_name);

Attempts to find a child element of parent named child_name . If no such child exists, the function returns NULL.

Parameters

parent

an XML node structure

 

child_name

element name of a child node

 

Returns

a child XML node structure, or NULL.

[nullable]

Types and Values