Re: convert xhtml back to html

2008-04-25 Thread Tim Arnold
"bryan rasmussen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'll second the recommendation to use xsl-t, set the output to html. > > > The code for an XSL-T to do it would be basically: > http://www.w3.org/1999/XSL/Transform"; > version="1.0"> > > > > > you would probabl

Re: convert xhtml back to html

2008-04-25 Thread Jim Washington
Stefan Behnel wrote: bryan rasmussen top-posted: On Thu, Apr 24, 2008 at 9:55 PM, Stefan Behnel <[EMAIL PROTECTED]> wrote: from lxml import etree tree = etree.parse("thefile.xhtml") tree.write("thefile.html", method="html") http://codespeak.net/lxml wow, that's pr

Re: convert xhtml back to html

2008-04-24 Thread Stefan Behnel
bryan rasmussen top-posted: > On Thu, Apr 24, 2008 at 9:55 PM, Stefan Behnel <[EMAIL PROTECTED]> wrote: >> from lxml import etree >> >> tree = etree.parse("thefile.xhtml") >> tree.write("thefile.html", method="html") >> >> http://codespeak.net/lxml > > wow, that's pretty nice there. >

Re: convert xhtml back to html

2008-04-24 Thread bryan rasmussen
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 <[EMAIL PROTECTED]> wrote: > Tim Arnold wrote: > > hi, I've got lots of xhtml pages that need to be fed to MS HTML Workshop

Re: convert xhtml back to html

2008-04-24 Thread Stefan Behnel
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. ) to plain html (e.g. ). This should do the job in lxml 2.x: from lxml import etree tr

Re: convert xhtml back to html

2008-04-24 Thread bryan rasmussen
I'll second the recommendation to use xsl-t, set the output to html. The code for an XSL-T to do it would be basically: http://www.w3.org/1999/XSL/Transform"; version="1.0"> you would probably want to do other stuff than just copy it out but that's another case. Also, from my recollecti

Re: convert xhtml back to html

2008-04-24 Thread M.-A. Lemburg
On 2008-04-24 19:16, John Krukoff wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:python- [EMAIL PROTECTED] On Behalf Of Tim Arnold Sent: Thursday, April 24, 2008 9:34 AM To: python-list@python.org Subject: convert xhtml back to html hi, I've got lots of xhtml pages that

RE: convert xhtml back to html

2008-04-24 Thread John Krukoff
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Tim Arnold > Sent: Thursday, April 24, 2008 9:34 AM > To: python-list@python.org > Subject: convert xhtml back to html > > hi, I've got lots of xhtml pages t

Re: convert xhtml back to html

2008-04-24 Thread Walter Dörwald
Arnaud Delobelle wrote: "Tim Arnold" <[EMAIL PROTECTED]> writes: 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. ) to plain html (e.g. ). Seems simple enough, but I

Re: convert xhtml back to html

2008-04-24 Thread Tim Arnold
"Arnaud Delobelle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Tim Arnold" <[EMAIL PROTECTED]> writes: > >> 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

Re: convert xhtml back to html

2008-04-24 Thread Tim Arnold
"Gary Herron" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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. ) to plain html (

Re: convert xhtml back to html

2008-04-24 Thread Arnaud Delobelle
"Tim Arnold" <[EMAIL PROTECTED]> writes: > 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. ) to plain html (e.g. ). > > Seems simple enough, but I'm having some tro

Re: convert xhtml back to html

2008-04-24 Thread Gary Herron
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. ) to plain html (e.g. ). Seems simple enough, but I'm having some trouble with it. regexps trip up

convert xhtml back to html

2008-04-24 Thread Tim Arnold
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. ) to plain html (e.g. ). Seems simple enough, but I'm having some trouble with it. regexps trip up because I also have