convert xhtml back to html
bryan rasmussen
rasmussen.bryan at gmail.com
Thu Apr 24 17:11:57 EDT 2008
wow, that's pretty nice there.
Just to know: what's the performance like on XML instances of 1 GB?
Cheers,
Bryan Rasmussen
On Thu, Apr 24, 2008 at 9:55 PM, Stefan Behnel <stefan_ml at behnel.de> wrote:
> Tim Arnold wrote:
> > hi, I've got lots of xhtml pages that need to be fed to MS HTML Workshop to
> > create CHM files. That application really hates xhtml, so I need to convert
> > self-ending tags (e.g. <br />) to plain html (e.g. <br>).
>
> This should do the job in lxml 2.x:
>
> from lxml import etree
>
> tree = etree.parse("thefile.xhtml")
> tree.write("thefile.html", method="html")
>
> http://codespeak.net/lxml
>
> Stefan
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
More information about the Python-list
mailing list