|
From: Artem Y. <ne...@gm...> - 2008-07-03 20:39:37
|
David Wolever wrote: > On 3-Jul-08, at 4:57 PM, Waylan Limberg wrote: >> Just remember the c variation will not work on IronPython, Jython or >> other python implementations. Additionally, there may be (shared) web >> hosts which will allow a user to copy a pure python module to the >> server, but not compile a c module. So if we do switch, the import >> should be in a try...except block and import the non-c variation if c >> is not available. In such a situation, would ElementTree give us any >> advantage? > My marginally educated but entirely untested guess is that it would > still be a bit faster... And certainly within the same order of > magnitude. > > Now, the problem: ElementTree will get really, really upset about > invalid XHTML. > Really upset. > So you'll need to figure out how you'll handle bad input (unclosed > tags, improper quoting, etc): As far as I understand all the HTML from input replacing by placeholders, and then inserting back only after serialization. So, it won't be a problem in this case. |