[ANN] HTMLTemplate 1.0.0

Duncan Booth me at privacy.net
Wed Jun 2 06:54:58 EDT 2004


David Fraser <davidf at sjsoft.com> wrote in news:c9ka2h$d57$1 at ctb-
nnrp2.saix.net:

>> Good work BUT
>> there are some other Python templating frameworks around, e.g.
>> 
>> - Cheetah
>> - ZOPE's TAL
>> - about half a dozen TAL derivatives
>> - Quixote's PTL
>> - SkunkWeb's STML
>> - Yaptu
>> - XYaptu
>> - Template Macro
>> 
>> Did you find these alternatives unsatisfactory? If somebody wants
>> to use a Python templating framework why should he prefer
>> HTMLTemplate?
>> 
>> Mit freundlichen Gruessen,
>> 
>> Peter Maas
>> 
> It looks cool because it doesn't embed Python code in the template.
> Do any of the other frameworks have this approach?
> 

The earlier Zope templating language DTML had the problem that it embedded 
logic in the templates, and this was one of the main factors behind the 
development of TAL and METAL. TAL still allows simple Python expressions, 
but these are in namespace protected attributes so that the actual template 
is always valid XHTML or XML, and it is quite possible to write TAL without 
using any Python expressions (indeed you can have a TAL implementation that 
doesn't support Python). Ensuring that TAL templates were valid XHTML was 
an important design goal because it allows ordinary HTML editors to be used 
on the template provided they preserve attributes from other namespaces.

By contrast, a template in HTMLTemplate isn't valid HTML since it contains 
undefined attributes in the default namespace. It is reasonable to expect 
that an HTML editor will strip out the illegal attributes.

The ultimate Python templating framework for separating Python from the 
template has to be PyMeld. PyMeld templates are pure XHTML with no 
additional attributes whatsoever.



More information about the Python-list mailing list