> If you like a more straightforward approach, TT also lets you write: > > <div dir="$language_dir"> > $some_content > </div> > > See, I knew there would be something that we would agree on! :-)
:) > > But at the risk of breaking compatibility with some validators / XML > > tools / etc. > > It still looks like valid XML to me. Where is the incompatability? Am > I missing something obvious? And it is. However if you have, say, <div id="[% VAR object.id %]"> then it's not XHTML anymore (spaces / weird chars not allowed as identifier...). I'm sure there's many more cases of nasty surprises. There's also cases in which with TT or H::T you have: [% IF expression %] <foo> [% FOR other_expression AS stuff %] ... some stuff </foo> [% END %] [% END %] Here the problem is obvious because the code is well indented. However with TAL syntax this simply cannot happen. Also, with TT you have to use the filter 'html' to XML encode your variables. Petal does it by default, and you need to use the TALES 'structure' keyword to NOT encode. This is because double encoded values are much easier to spot and debug than badly encoded ones. To summarize, I think Petal is more specialized in XML templating and has the strength of a very smart, open specification written by the Zope people. Petal fills a niche across the XML and the templating world and is certainly not a replacement for TT. Actually, as Steve Purkis suggested on the Petal mailing list it would be possible to implement Petal on top of TT. Maybe for Petal 2.00! To conclude, and in order to satisfy my little ego I think both libraries are deadly cool. Plus I would never have dreamed of the author of TT arguing about the pros and cons of TT vs Petal with me when I started writing the library a little more than a year ago. That in itself is a great reward :-) Cheers, Jean-Michel.