Am 18.12.2011 01:26, schrieb jerry:
Besides, when both the number and complexity of your templates grow,
it'll be appreciated more and more that your final HTML will be well-
formed (and free from XSS attack) so long as each individual template
is validated. This is kind of like unit testing to me.
Last but not the least, XML templates are more designer friendly than
their non-XML counterparts.
That's why I'm still with Genshi while waiting for Chameleon to be
ready for prime time.
Though I've mainly used Genshi and its predecessor Kid so far, I doubt
that Chameleon is less mature than Genshi. Anyway, your're right, these
template languages are not meant as a replacement for XSLT. The point is
that as attribute languages they guarantee well-formedness and the
templates themselves are well-formed and valid XHTML, so they can be
processed with design tools and the whole XML tool chain. I like the
fact that you can say <p py:content="therealtext">Lorem ipsum</p> and
preview the template like it was an ordinary HTML file. However, you
need some discipline to write "proper" templates. I see many people
using ${...} substion in Genshi everywhere. If you do this, you loose
the benefits of an attribute language and can just as well use Mako.
Since HTML5 has superseded XHTML, well-formedness is becoming a less
important aspect, and I started to use Jinja2 which has also many nice
features. Jinja2 is also similar to Django templates, so it's more
commonly known and supported by many IDEs (syntax highlighting etc.).
Jinja2 is also available for Pyramid projects via pyramid_jinja2.
-- Christoph
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.