[ZPT] "structure" and TAL interpretation

Jean-Michel Hiver jhiver at mkdoc.com
Fri Jul 23 12:11:17 EDT 2004


>Except in the Python implementation, saying "structure" also means to
>re-evaluate TAL markup returned as part of the replacement.  So I'd
>claim that Petal doesn't implement the same language as the TAL (Zope
>2) or zope.tal (Zope 3) Python packages.
>
Well, /methinks it's close enough :-)

The fact that you cannot do tal:replace="structure string: <span 
tal:replace="string:foo"/>"
(which I find a bit crazy anyway) does not mean that it doesn't 
implement the TAL syntax.

Petal tries to implement the TAL spec to:

* Accommodating backwards compatibility and past design mistakes :-/
* The best of my little Perl abilities and available time
* According to the published specification

>What's interesting to note is that this re-evaluation of the
>replacement text for "structure" doesn't seem to be mentioned in the
>specification:
>
>http://zope.org/Wikis/DevSite/Projects/ZPT/TAL%20Specification%201.4
>
And I think it is a _good_ thing.

If the specification was tied too closely with the current 
implementation, it would not leave much room for alternative 
implementations.

And to be honest, I think that's the really cool thing about TAL: the 
specification. It means that templateers can re-use their knowledge 
across Python, Perl, PHP and Java - I don't think that any other 
templating spec can claim that.

Also it's nice to be able to use third party tools such as i18ndude...

(BTW, any plans to release i18nextract.py as a separate package? That'd 
be very cool...)



More information about the ZPT mailing list