Top | ![]() |
![]() |
![]() |
![]() |
EXmlDocument * | e_xml_document_new () |
xmlDoc * | e_xml_document_get_xmldoc () |
gchar * | e_xml_document_get_content () |
void | e_xml_document_add_namespaces () |
void | e_xml_document_start_element () |
void | e_xml_document_start_text_element () |
void | e_xml_document_end_element () |
void | e_xml_document_add_empty_element () |
void | e_xml_document_add_attribute () |
void | e_xml_document_add_attribute_int () |
void | e_xml_document_add_attribute_double () |
void | e_xml_document_add_attribute_time () |
void | e_xml_document_write_int () |
void | e_xml_document_write_double () |
void | e_xml_document_write_base64 () |
void | e_xml_document_write_time () |
void | e_xml_document_write_string () |
void | e_xml_document_write_buffer () |
EXmlDocument * e_xml_document_new (const gchar *ns_href
,const gchar *root_element
);
Creates a new EXmlDocument with root element root_element
and optionally
also with set default namespace ns_href
.
ns_href |
default namespace href to use, or |
[nullable] |
root_element |
root element name |
Since: 3.26
gchar * e_xml_document_get_content (const EXmlDocument *xml
,gsize *out_length
);
Gets content of the xml
as string. The string is nul-terminated, but
if out_length
is also provided, then it doesn't contain this additional
nul character.
xml |
an EXmlDocument |
|
out_length |
optional return location for length of the content, or |
[out][nullable] |
Content of the xml
as newly allocated string.
Free it with g_free()
, when no longer needed.
[transfer full]
Since: 3.26
void e_xml_document_add_namespaces (EXmlDocument *xml
,const gchar *ns_prefix
,const gchar *ns_href
,...
);
Adds one or more namespaces to xml
, which can be referenced
later by ns_href
. The caller should take care that neither
used ns_prefix
, nor ns_href
, is already used by xml
.
xml |
an EXmlDocument |
|
ns_prefix |
namespace prefix to use for this namespace |
|
ns_href |
namespace href |
|
... |
|
Since: 3.26
void e_xml_document_start_element (EXmlDocument *xml
,const gchar *ns_href
,const gchar *name
);
Starts a new non-text element as a child of the current element.
Each such call should be ended with corresponding e_xml_document_end_element()
.
Use NULL
ns_href
, to use the default namespace, otherwise either previously
added namespace with the same href from e_xml_document_add_namespaces()
is picked,
or a new namespace with generated prefix is added.
To start a text node use e_xml_document_start_text_element()
.
xml |
an EXmlDocument |
|
ns_href |
optional namespace href for the new element, or |
[nullable] |
name |
name of the new element |
Since: 3.26
void e_xml_document_start_text_element (EXmlDocument *xml
,const gchar *ns_href
,const gchar *name
);
Starts a new text element as a child of the current element.
Each such call should be ended with corresponding e_xml_document_end_element()
.
Use NULL
ns_href
, to use the default namespace, otherwise either previously
added namespace with the same href from e_xml_document_add_namespaces()
is picked,
or a new namespace with generated prefix is added.
To start a non-text node use e_xml_document_start_element()
.
xml |
an EXmlDocument |
|
ns_href |
optional namespace href for the new element, or |
[nullable] |
name |
name of the new element |
Since: 3.26
void
e_xml_document_end_element (EXmlDocument *xml
);
This is a pair function for e_xml_document_start_element()
and
e_xml_document_start_text_element()
, which changes current
element to the parent of that element.
Since: 3.26
void e_xml_document_add_empty_element (EXmlDocument *xml
,const gchar *ns_href
,const gchar *name
);
Adds an empty element, which is an element with no attribute and no value.
It's the same as calling e_xml_document_start_element()
immediately
followed by e_xml_document_end_element()
.
xml |
an EXmlDocument |
|
ns_href |
optional namespace href for the new element, or |
[nullable] |
name |
name of the new element |
Since: 3.26
void e_xml_document_add_attribute (EXmlDocument *xml
,const gchar *ns_href
,const gchar *name
,const gchar *value
);
Adds a new attribute to the current element.
Use NULL
ns_href
, to use the default namespace, otherwise either previously
added namespace with the same href from e_xml_document_add_namespaces()
is picked,
or a new namespace with generated prefix is added.
xml |
an EXmlDocument |
|
ns_href |
optional namespace href for the new attribute, or |
[nullable] |
name |
name of the attribute |
|
value |
value of the attribute |
Since: 3.26
void e_xml_document_add_attribute_int (EXmlDocument *xml
,const gchar *ns_href
,const gchar *name
,gint64 value
);
Adds a new attribute with an integer value to the current element.
Use NULL
ns_href
, to use the default namespace, otherwise either previously
added namespace with the same href from e_xml_document_add_namespaces()
is picked,
or a new namespace with generated prefix is added.
xml |
an EXmlDocument |
|
ns_href |
optional namespace href for the new attribute, or |
[nullable] |
name |
name of the attribute |
|
value |
integer value of the attribute |
Since: 3.26
void e_xml_document_add_attribute_double (EXmlDocument *xml
,const gchar *ns_href
,const gchar *name
,gdouble value
);
Adds a new attribute with a double value to the current element.
Use NULL
ns_href
, to use the default namespace, otherwise either previously
added namespace with the same href from e_xml_document_add_namespaces()
is picked,
or a new namespace with generated prefix is added.
xml |
an EXmlDocument |
|
ns_href |
optional namespace href for the new attribute, or |
[nullable] |
name |
name of the attribute |
|
value |
double value of the attribute |
Since: 3.26
void e_xml_document_add_attribute_time (EXmlDocument *xml
,const gchar *ns_href
,const gchar *name
,time_t value
);
Adds a new attribute with a time_t value in ISO 8601 format to the current element.
The format is "YYYY-MM-DDTHH:MM:SSZ".
Use NULL
ns_href
, to use the default namespace, otherwise either previously
added namespace with the same href from e_xml_document_add_namespaces()
is picked,
or a new namespace with generated prefix is added.
xml |
an EXmlDocument |
|
ns_href |
optional namespace href for the new attribute, or |
[nullable] |
name |
name of the attribute |
|
value |
time_t value of the attribute |
Since: 3.26
void e_xml_document_write_int (EXmlDocument *xml
,gint64 value
);
Writes value
as content of the current element.
Since: 3.26
void e_xml_document_write_double (EXmlDocument *xml
,gdouble value
);
Writes value
as content of the current element.
Since: 3.26
void e_xml_document_write_base64 (EXmlDocument *xml
,const gchar *value
,gint len
);
Writes value
of length len
, encoded to base64, as content of the current element.
Since: 3.26
void e_xml_document_write_time (EXmlDocument *xml
,time_t value
);
Writes value
in ISO 8601 format as content of the current element.
The format is "YYYY-MM-DDTHH:MM:SSZ".
Since: 3.26
void e_xml_document_write_string (EXmlDocument *xml
,const gchar *value
);
Writes value
as content of the current element.
Since: 3.26
void e_xml_document_write_buffer (EXmlDocument *xml
,const gchar *value
,gint len
);
Writes value
of length len
as content of the current element.
Since: 3.26
struct EXmlDocument { };
Contains only private data that should be read and manipulated using the functions below.
Since: 3.26