PSP, Cheetah, PTL, ZOPE, etc ...

Andrew Kuchling akuchlin at mems-exchange.org
Sat Aug 4 14:03:15 EDT 2001


paul at boddie.net (Paul Boddie) writes:
> >         well. Most templating languages assume the content is mostly
> >         HTML with just a few small bits of program code here and
> 
> I would say that most "small" template languages are like that, but
> DTML, JSP and ASP surely support almost any kind of textual document.
> Only supporting HTML in a template system is far too limiting in my
> view. Enhydra's XMLC seems to be constrained in certain additional

The assumption I'm talking about isn't that the output is assumed to
be HTML or text, but that templates are assumed to be mostly plain
HTML with only occasional escapes into program code or variable
expansions.  That assumption may have once been true, and still is if
all you're doing is inserting the current date or picking a random
quotation; one <!--#thingy--> and you're done, but for most modern,
heavily dynamic Web sites I expect the density of program code is much
higher.

> But doesn't this help to obscure the form of the final document? I was
> once an advocate of building pages up from well-defined, "trusted"
> components which represent a particular concept, but there are some
> situations where logical components of a document don't just fit into
> a self-contained part of a document; for example, attributes of
> objects that one is trying to represent may be mixed together into
> adjacent cells in an HTML table.

I'm not clear on what you mean; can you give a clearer example?
Surely the code to generate the entire table can be rolled up into a
single function, which answers much the same purpose.

Incidentally, it strikes me that Quixote might be easier to use with
Jython than Zope is.  The hardest part would be translating the PTL
template generator because that uses the compiler module to generate
Python bytecodes; perhaps it could be changed to generate straight
Python output which could then be run through Jython's compiler.  I
see no way to give that acceptable performance, though.

--amk



More information about the Python-list mailing list