Login to your account |
Other Options |

There are a number of (very good) templating systems and languages available for Python. They fall in to one of two camps; either they are XML based, like Genshi, or they are text based, like Mako. Most programmers favour one or the other, but there is far from a consensus over which is better.
I'd like to use this debate to gather reasons for using one over the other in the context of web development. I suspect there will be no clear winner, but it should serve as a useful resource for those faced with the decision!
NB. You can post code with the [code] bbcode tag. Many languages are supported. e.g.
[code python]
print "Hello, World!"
[/code]
If your output is XML, it makes sense for your input to be XML as well. XML template engines can guarantee that their output will be well-formed XML; text engines can only produce valid XML if the templates authors are incredibly careful, and can't gaurantee well-formed output. If your application is ouputting mainly XHTML, RSS and the like an XML template engine is a really good idea.
According to Paddy:
Simon, non-XML templating engines can create just as well-formed XML/X HTML output.