Re: convert xhtml back to html

2008-04-25 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. Just to know: what's

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 pretty

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: xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; version=1.0 xsl:output

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. br /) to plain html (e.g. br). Seems simple enough, but I'm having some trouble with it. regexps trip up because I

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. br /) to plain html (e.g. br). Seems simple enough, but I'm having some trouble with it. regexps

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. br /) to plain html (e.g. br). Seems simple enough, but I'm having some

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. br /) to plain html (e.g.

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-ending tags (e.g.

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. br /) to plain html (e.g. br). Seems simple enough,

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 that need to be fed to MS HTML Workshop

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 need

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: xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; version=1.0 xsl:output method=html / xsl:template match=/xsl:copy-of select=///xsl:template /xsl:stylesheet

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. br /) to plain html (e.g. br). This should do the job in lxml 2.x: from lxml import etree

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 to