Package pyxmpp2 :: Module xmppparser :: Class ParserTarget
[hide private]

Class ParserTarget


Element tree parser events handler for the XMPP stream parser.
Instance Methods [hide private]
 
__init__(self, handler)
Initialize the SAX handler.
 
data(self, data)
Handle XML text data.
 
start(self, tag, attrs)
Handle the start tag.
 
close(self)
Handle the stream end.
 
end(self, tag)
Handle an end tag.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, handler)
(Constructor)

 
Initialize the SAX handler.
Parameters:
Overrides: object.__init__

data(self, data)

 

Handle XML text data.

Ignore the data outside the root element and directly under the root, pass all other text to the tree builder, so it will be included in the stanzas.

start(self, tag, attrs)

 

Handle the start tag.

Call the handler's 'stream_start' methods with an empty root element if it is top level.

For lower level tags use ElementTree.TreeBuilder to collect them.

end(self, tag)

 

Handle an end tag.

Call the handler's 'stream_end' method with an the root element (built by the start method).

On the first level below root, sent the built element tree to the handler via the 'stanza methods'.

Any tag below will be just added to the tree builder.