Tino Wildenhain wrote:



An opposite approach to this form of dynamic HTML production is called
push-style templating, as coined by Terence Parr:

Hm.

"<a href=$attr.url$>$attr.title$</a>
$if(attr.active)$
$attr.submenu:menuItem()$
$endif$"

This looks ugly to me.
It looks ugly to me too.
Why not just using well tested TAL, which is
also available for a number of languages?
well, to me, TAL has to be learned. It is a language. Why is this an issue? Let me answer: I already know Python. I already know the XHTML standard. I do not wish to learn TAL. If you know Python, and can read the API to a high-quality XML processing toolkit, then you are done. TAL introduces another language and I have to learn its conventions and idiosyncrasies.

Now, the same would be true of Terence Parr's StringTemplate engine. It is small, only 4 commands, but it litters the template with too much if you ask me.

I like the approach of my own HTML::Seamstress --- object-oriented Perl and knowledge of an object-oriented tree-rewriting library is all you need:
http://search.cpan.org/~tbone/HTML-Seamstress-5.0b/lib/HTML/Seamstress.pod#Text_substitution_via_replace_content()_API_call.


http://en.wikipedia.org/wiki/Template_Attribute_Language

In contrast there would be something like TSSL, which
unfortunately never saw the light of the day yet :-)

http://mail.zope.org/pipermail/zpt/2002-May/003304.html

(This solution would not even touch the HTML directly)
just remember: XHTML is a subset of XML and no one ever touches XML directly. There really is no reason for HTML to be handled any differently than XML. That TSSL is a nightmare. It's trying to be a programming language. And again, we already have Perl/Python, so why bother? You can avoid touching HTML by using Python.

Thank you for writing. I enjoyed the discussion.


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to