EDataServer.XmlDocument

g EDataServer.XmlDocument EDataServer.XmlDocument GObject.Object GObject.Object GObject.Object->EDataServer.XmlDocument

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (ns_href, root_element)

add_attribute (ns_href, name, value)

add_attribute_double (ns_href, name, value)

add_attribute_int (ns_href, name, value)

add_attribute_time (ns_href, name, value)

add_attribute_time_ical (ns_href, name, value)

add_empty_element (ns_href, name)

end_element ()

get_content ()

get_xmldoc ()

start_element (ns_href, name)

start_text_element (ns_href, name)

write_base64 (value, len)

write_buffer (value, len)

write_double (value)

write_int (value)

write_string (value)

write_time (value)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class EDataServer.XmlDocument(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

EDataServer.XmlDocumentClass

Contains only private data that should be read and manipulated using the functions below.

New in version 3.26.

classmethod new(ns_href, root_element)
Parameters:
  • ns_href (str or None) – default namespace href to use, or None

  • root_element (str) – root element name

Returns:

a new EDataServer.XmlDocument; free it with GObject.Object.unref(), when no longer needed.

Return type:

EDataServer.XmlDocument

Creates a new EDataServer.XmlDocument with root element root_element and optionally also with set default namespace ns_href.

New in version 3.26.

add_attribute(ns_href, name, value)
Parameters:
  • ns_href (str or None) – optional namespace href for the new attribute, or None

  • name (str) – name of the attribute

  • value (str) – value of the attribute

Adds a new attribute to the current element. Use None 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.

New in version 3.26.

add_attribute_double(ns_href, name, value)
Parameters:
  • ns_href (str or None) – optional namespace href for the new attribute, or None

  • name (str) – name of the attribute

  • value (float) – double value of the attribute

Adds a new attribute with a double value to the current element. Use None 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.

New in version 3.26.

add_attribute_int(ns_href, name, value)
Parameters:
  • ns_href (str or None) – optional namespace href for the new attribute, or None

  • name (str) – name of the attribute

  • value (int) – integer value of the attribute

Adds a new attribute with an integer value to the current element. Use None 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.

New in version 3.26.

add_attribute_time(ns_href, name, value)
Parameters:
  • ns_href (str or None) – optional namespace href for the new attribute, or None

  • name (str) – name of the attribute

  • value (int) – time_t value of the attribute

Adds a new attribute with a time_t value in ISO 8601 format to the current element. The format is “YYYY-MM-DDTHH:MM:py:data::SSZ<EDataServer.XmlDocument.props.SSZ>". Use None 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.

New in version 3.26.

add_attribute_time_ical(ns_href, name, value)
Parameters:
  • ns_href (str or None) – optional namespace href for the new attribute, or None

  • name (str) – name of the attribute

  • value (int) – time_t value of the attribute

Adds a new attribute with a time_t value in iCalendar format to the current element. The format is “YYYYMMDDTHHMMSSZ”. Use None 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.

New in version 3.32.

add_empty_element(ns_href, name)
Parameters:
  • ns_href (str or None) – optional namespace href for the new element, or None

  • name (str) – name of the new element

Adds an empty element, which is an element with no attribute and no value.

It’s the same as calling EDataServer.XmlDocument.start_element() immediately followed by EDataServer.XmlDocument.end_element().

New in version 3.26.

end_element()

This is a pair function for EDataServer.XmlDocument.start_element() and EDataServer.XmlDocument.start_text_element(), which changes current element to the parent of that element.

New in version 3.26.

get_content()
Returns:

Content of the self as newly allocated string. Free it with GLib.free(), when no longer needed.

out_length:

optional return location for length of the content, or None

Return type:

(str, out_length: int)

Gets content of the self as string. The string is nul-terminated, but if out_length is also provided, then it doesn’t contain this additional nul character.

New in version 3.26.

get_xmldoc()
Returns:

Underlying libxml2.DocPtr.

Return type:

libxml2.Doc

New in version 3.26.

start_element(ns_href, name)
Parameters:
  • ns_href (str or None) – optional namespace href for the new element, or None

  • name (str) – name of the new element

Starts a new non-text element as a child of the current element. Each such call should be ended with corresponding EDataServer.XmlDocument.end_element(). Use None 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 EDataServer.XmlDocument.start_text_element().

New in version 3.26.

start_text_element(ns_href, name)
Parameters:
  • ns_href (str or None) – optional namespace href for the new element, or None

  • name (str) – name of the new element

Starts a new text element as a child of the current element. Each such call should be ended with corresponding EDataServer.XmlDocument.end_element(). Use None 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 EDataServer.XmlDocument.start_element().

New in version 3.26.

write_base64(value, len)
Parameters:
  • value (str) – value to write as the content

  • len (int) – length of value

Writes value of length len, encoded to base64, as content of the current element.

New in version 3.26.

write_buffer(value, len)
Parameters:
  • value (str) – value to write as the content

  • len (int) – length of value

Writes value of length len as content of the current element.

New in version 3.26.

write_double(value)
Parameters:

value (float) – value to write as the content

Writes value as content of the current element.

New in version 3.26.

write_int(value)
Parameters:

value (int) – value to write as the content

Writes value as content of the current element.

New in version 3.26.

write_string(value)
Parameters:

value (str) – value to write as the content

Writes value as content of the current element.

New in version 3.26.

write_time(value)
Parameters:

value (int) – value to write as the content

Writes value in ISO 8601 format as content of the current element. The format is “YYYY-MM-DDTHH:MM:py:data::SSZ<EDataServer.XmlDocument.props.SSZ>".

New in version 3.26.