Skip to content
Back to top
View this page

# Root Stanza

class slixmpp.stanza.rootstanza.RootStanza(stream=None, xml=None, stype=None, sto=None, sfrom=None, sid=None, parent=None, recv=False)

  A top-level XMPP stanza in an XMLStream.

  The RootStanza class provides a more XMPP specific exception handler than provided by the generic StanzaBase class.

  Methods:

    exception – Overrides StanzaBase.exception

  exception(e)

    Create and send an error reply.

    Typically called when an event handler raises an exception. The error’s type and text content are based on the exception object’s type and content.

    Overrides StanzaBase.exception.

    Arguments:

      e – Exception object

  plugin_attrib_map: ClassVar[dict[str, type[ElementBase]]] = {'error': <class 'slixmpp.stanza.error.Error'>}

    A mapping of the `plugin_attrib` values of registered plugins to their respective classes.

  plugin_iterables: ClassVar[set[type[ElementBase]]] = {}

    The set of stanza classes that can be iterated over using the ‘substanzas’ interface. Classes are added to this set when registering a plugin with `iterable=True`:

        register_stanza_plugin(DiscoInfo, DiscoItem, iterable=True)

    Added in version 1.0-Beta5.

  plugin_overrides: ClassVar[dict[str, str]] = {}

    A map of interface operations to the overriding functions. For example, after overriding the `set` operation for the interface `body`, `plugin_overrides` would be:

        {'set_body': <some function>}

  plugin_tag_map: ClassVar[dict[str, type[ElementBase]]] = {'{jabber:client}error': <class 'slixmpp.stanza.error.Error'>}

    A mapping of root element tag names (in `'{namespace}elementname'` format) to the plugin classes responsible for them.