ElementTreeStream: wrap ElementTree in a Stream
|Reported by:||gavin@…||Owned by:||cmlenz|
|Component:||Template engine plugin||Version:||0.3.3|
The attached class wraps an ElementTree element to create a genshi.core.Stream. It is probably a drop-in replacement for the current ET function.
This means you can select(...) the stream. Some paths possible with Genshi do not have equivalents in ElementTree, AFAIK, partly because text nodes are just attributes of elements in ET.
As a convenience. the class also unwraps lists passed in, specifically to handle the result of element.findall(...).