obscure problem using elementtree to make xhtml website

Lee hogney at gmail.com
Thu Sep 3 09:43:08 EDT 2009


Elementtree (python xml parser) will transform markup like

<tag boo="baa"></tag>

into

<tag boo="baa" />

which is a reasonable thing to do for xml (called minimization, I
think).

But this caused an obscure problem when I used it to create the xhtml
parts of my website,
causing Internet Explorer to display nearly blank pages. I explain the
details at

http://lee-phillips.org/scripttag/

and am writing here as a heads-up to anyone who might be using a
workflow similar to mine: writing documents in xml and using python
and elementtree to transform those into xhtml webpages, and using the
standard kludge of serving them as text/html to IE, to get around the
latter's inability to handle xml. I can't be the only one (and I doubt
this problem is confined to elementtree).


Lee Phillips



More information about the Python-list mailing list