pyxmpp.objects.StanzaPayloadWrapperObject

Package pyxmpp :: Module objects :: Class StanzaPayloadWrapperObject |
[show private | hide private]
[frames | no frames]

## Type StanzaPayloadWrapperObject

    object --+
             |
            StanzaPayloadWrapperObject

Known Subclasses:
  `DiscoIdentity`, `DiscoInfo`, `DiscoItem`, `DiscoItems`, `MucXBase`

Base class for objects that may be used as XMPP stanza payload and maintain an internal XML representation of self.

Provides `as_xml` method. Objects of derived classes must have the `xmlnode` attribute.

Please note that not all classes derived from `StanzaPayloadWrapperObject` should be used directly as stanza payload. Some of them are parts of higher level objects.

Method Summary
`libxml2.xmlNode` or `libxml2.xmlDoc` | ``as_xml`(self, parent, doc)` Get the XML representation of `self`.
Inherited from object
| ``__init__`(...)` x.__init__(...) initializes x; see x.__class__.__doc__ for signature
| ``__delattr__`(...)` x.__delattr__('name') <==> del x.name
| ``__getattribute__`(...)` x.__getattribute__('name') <==> x.name
| ``__hash__`(x)` x.__hash__() <==> hash(x)
| ``__new__`(T, S, ...)` T.__new__(S, ...) -> a new object with type S, a subtype of T
| ``__reduce__`(...)` helper for pickle
| ``__reduce_ex__`(...)` helper for pickle
| ``__repr__`(x)` x.__repr__() <==> repr(x)
| ``__setattr__`(...)` x.__setattr__('name', value) <==> x.name = value
| ``__str__`(x)` x.__str__() <==> str(x)

Instance Variable Summary
`libxml2.xmlNode` | `xmlnode`: XML node of the object.

Method Details

### as_xml(self, parent=None, doc=None) Get the XML representation of `self`. New document will be created if no `parent` and no `doc` is given. Parameters: `parent` - the parent for the XML element. (type=`libxml2.xmlNode`) `doc` - the document where the element should be created. If not given and `parent` is provided then autodetection is attempted. If that fails, then `common_doc` is used. (type=`libxml2.xmlDoc`) Returns: the new XML element (copy of `self.xmlnode`) or document created (containg the copy as the root element). (type=`libxml2.xmlNode` or `libxml2.xmlDoc`)

Instance Variable Details

### xmlnode XML node of the object. Type: `libxml2.xmlNode`