pyxmpp.xmlextra.StreamHandler

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.

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`)