Home Login Create account Contact Help
Close

Login to your account

Other Options

Comments feed

In response to XML or Text for Python Templates?

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] 



Martijn Faassen argues for "XML"
Mon, 15 Oct 2007 by faassen
Rank 8. Average +0.5 ( 2 votes )

XML and XHTML validation tools work out of the box with XML-based templates. Text-based templates do not. If faced with the task of validating a large number of templates according to some schema, it will be easier with XML-based templates.

Paddy comments...
Tue, 16 Oct 2007 by paddy3118
Equally, some text based templating systems work by translation to an intermediate language, and the translater and compiler/interpreter will check for 'well-formedness'.
Martijn Faassen comments...
Tue, 16 Oct 2007 by faassen
I'm not trying to exclude the possibility that a text template language can do this. It's just not going to be as easy - extra work is required to do it, both on the template language implementor's side and the actual template language users.


Return to debate