Top | ![]() |
![]() |
![]() |
![]() |
void | e_xml_initialize_in_main () |
xmlDoc * | e_xml_parse_file () |
gint | e_xml_save_file () |
xmlNode * | e_xml_get_child_by_name () |
xmlDoc * | e_xml_parse_data () |
xmlXPathContext * | e_xml_new_xpath_context_with_namespaces () |
void | e_xml_xpath_context_register_namespaces () |
xmlXPathObject * | e_xml_xpath_eval () |
gchar * | e_xml_xpath_eval_as_string () |
gboolean | e_xml_xpath_eval_exists () |
void
e_xml_initialize_in_main (void
);
Initializes libxml library global memory. This should be called in the main thread. The function does nothing, when it had been called already.
[skip]
Since: 3.28
xmlDoc *
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
.
[skip]
gint e_xml_save_file (const gchar *filename
,xmlDoc *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.
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
.
[skip]
xmlDoc * e_xml_parse_data (gconstpointer data
,gsize length
);
Parses XML data into an xmlDocPtr. Free returned pointer
with xmlFreeDoc()
, when no longer needed.
[skip]
data |
an XML data. |
[array length=length][element-type guint8] |
length |
length of data, should be greated than zero |
Since: 3.26
xmlXPathContext * e_xml_new_xpath_context_with_namespaces (xmlDoc *doc
,...
);
Creates a new xmlXPathContextPtr on doc
with preregistered
namespaces. The namepsaces are pair of (prefix, href), terminated
by NULL
.
[skip]
a new xmlXPathContextPtr. Free the returned
pointer with xmlXPathFreeContext()
when no longer needed.
[transfer full]
Since: 3.26
void e_xml_xpath_context_register_namespaces (xmlXPathContext *xpath_ctx
,const gchar *prefix
,const gchar *href
,...
);
Registers one or more additional namespaces. It's a caller's error to try to register a namespace with the same prefix again, unless the prefix uses the same namespace href.
[skip]
xpath_ctx |
an xmlXPathContextPtr |
|
prefix |
namespace prefix |
|
href |
namespace href |
|
... |
|
Since: 3.26
xmlXPathObject * e_xml_xpath_eval (xmlXPathContext *xpath_ctx
,const gchar *format
,...
);
Evaluates path specified by format
and returns its xmlXPathObjectPtr,
in case the path evaluates to a non-empty node set. See also
e_xml_xpath_eval_as_string()
which evaluates the path to string.
[skip]
xpath_ctx |
an xmlXPathContextPtr |
|
format |
printf-like format specifier of path to evaluate |
|
... |
arguments for the |
a new xmlXPathObjectPtr which
references given path, or NULL
if path cannot be found or when
it evaluates to an empty nodeset. Free returned pointer with
xmlXPathFreeObject()
, when no longer needed.
[nullable][transfer full]
Since: 3.26
gchar * e_xml_xpath_eval_as_string (xmlXPathContext *xpath_ctx
,const gchar *format
,...
);
Evaluates path specified by format
and returns its result as string,
in case the path evaluates to a non-empty node set. See also
e_xml_xpath_eval()
which evaluates the path to an xmlXPathObjectPtr.
[skip]
xpath_ctx |
an xmlXPathContextPtr |
|
format |
printf-like format specifier of path to evaluate |
|
... |
arguments for the |
a new string which contains value
of the given path, or NULL
if path cannot be found or when
it evaluates to an empty nodeset. Free returned pointer with
g_free()
, when no longer needed.
[nullable][transfer full]
Since: 3.26
gboolean e_xml_xpath_eval_exists (xmlXPathContext *xpath_ctx
,const gchar *format
,...
);
Evaluates path specified by format
and returns whether it exists.
[skip]
xpath_ctx |
an xmlXPathContextPtr |
|
format |
printf-like format specifier of path to evaluate |
|
... |
arguments for the |
Since: 3.26