lxml and SimpleXMLWriter

Stefan Behnel stefan.behnel-n05pAM at web.de
Thu Jul 6 13:49:34 EDT 2006


Srijit Kumar Bhadra wrote:
> I am new to lxml. I am interested to know the equivalent code using
> lxml (http://cheeseshop.python.org/pypi/lxml/1.1alpha). The code is
> taken from http://effbot.org/zone/xml-writer.htm
> 
> from elementtree.SimpleXMLWriter import XMLWriter
> import sys
> 
> w = XMLWriter(sys.stdout)
> 
> html = w.start("html")
[snip]

Note that the SimpleXMLWriter is in no way related to the ElementTree
implementation. Feel free to copy the module from the elementtree package and
use it with lxml.

Stefan



More information about the Python-list mailing list