[Web-SIG] htmlgen

Simon Willison cs1spw at bath.ac.uk
Wed Oct 29 17:26:43 EST 2003


Ian Bicking wrote:
> HTMLgen has some quirkiness to it, though.  It's not as tight as a 
> simple HTML generator could be.  Would it make sense to use a more 
> minimal XML generator, that could also do XHTML generation (maybe with a 
> little validation thrown in)?  Is there any library like this already 
> included in Python xml packages?  I do like generating HTML with a 
> Python syntax (when in-code HTML generation is called for).

I think any XML generating libraries would be more suited to the xml 
package than the web package. Personally I'm not too keen on including 
any HTML generation or templating capabilities in the standard library - 
a large number of templating systems already exist, mainly because 
there's no "one obvious way" of doing templating so people tend to go 
with different solutions based on personal preference.

As a side note, I'm a big fan of this XMLWriter class for generating 
XML. It uses an extremely simple stack based push/pop model: 
http://www.xml.com/pub/a/2003/04/09/py-xml.html

-- 
Simon Willison
Web development weblog: http://simon.incutio.com/




More information about the Web-SIG mailing list