[TransWarp] Template parsing and XML/HTML processing design

Roché Compaan roche at upfrontsystems.co.za
Mon Jul 21 07:42:13 EDT 2003


* Phillip J. Eby <pje at telecommunity.com> [2003-07-21 03:22]:
> At 07:53 PM 7/20/03 +0200, Jean Jordaan wrote:
> 
> >I really like my Zope Page Templates --- they recently gave me a lot of
> >joy customizing Roundup ( http://roundup.sf.net ) which has no Zope
> >dependency and bundles ZPT. And TALES also makes writing Zope Formulator
> >forms a joy. Is PEAK templates something different entirely? What do you
> >think of ZPT?
> 
> I think that ZPT still embed code in a web page, and that there's a better 
> alternative.  If you've seen PSO (pso.sf.net), Twisted's Woven, or even JSP 
> taglibs (though that's a bit of a stretch), you'll have a better idea of 
> what PWT (peak.web.templates) looks like.  Here's an example, straight from 
> the test suite:
> 
> <body>
> <h1 model="foo" view="text">Title Goes Here</h1>
> <ul model="bar" view="list">
>     <li pattern="listItem" view="text"></li>
> </ul>
> </body>

I really think this is a step backwards as far as templating
technologies goes. Jean already mentioned the lack of a separate
namespace for special attributes. Additionally I think to enforce
the separation of ui and code to death is extreme. Some logic is
legitimate in templating, specifically simple expressions that serves
only the presentation. Off course you can go overboard with ZPT's
"python:" expressions but PEAK does not need to make that available on
the context if it is strongly against python expressions in the
template.

I often find that it is too expensive to create a class or python script
when I build templates and simple "python:" expressions are very useful
then.

-- 
Roché Compaan
Upfront Systems                 http://www.upfrontsystems.co.za



More information about the PEAK mailing list