Package pyxmpp :: Module xmlextra :: Class StreamHandler
[show private | hide private]
[frames | no frames]

Class StreamHandler

Known Subclasses:
StreamBase

Base class for stream handler.
Method Summary
  __init__(self)
  error(self, descr)
Called when an error is encountered in the stream.
  stanza(self, _unused, node)
Called when the end tag of a direct child of the root element is encountered in the stream.
  stream_end(self, doc)
Called when the end tag of root element is encountered in the stream.
  stream_start(self, doc)
Called when the start tag of root element is encountered in the stream.
  _stanza(self, _doc, _node)
Process complete stanza.
  _stream_end(self, _doc)
Process stream end.
  _stream_start(self, _doc)
Process stream start.

Method Details

error(self, descr)

Called when an error is encountered in the stream.
Parameters:
descr - description of the error
           (type=str)

stanza(self, _unused, node)

Called when the end tag of a direct child of the root element is encountered in the stream.

Please note, that node will be removed from the document and freed after this method returns. If it is needed after that a copy must be made before the method returns.

Parameters:
_unused - the document being parsed.
           (type=libxml2.xmlDoc)
node - the (complete) element being processed
           (type=libxml2.xmlNode)

stream_end(self, doc)

Called when the end tag of root element is encountered in the stream.
Parameters:
doc - the document being parsed.
           (type=libxml2.xmlDoc)

stream_start(self, doc)

Called when the start tag of root element is encountered in the stream.
Parameters:
doc - the document being parsed.
           (type=libxml2.xmlDoc)

_stanza(self, _doc, _node)

Process complete stanza.

_stream_end(self, _doc)

Process stream end.

_stream_start(self, _doc)

Process stream start.