push-style templating - an xml-like way to process xhtml

Terrence Brannon metaperl at gmail.com
Sun Nov 2 03:48:40 EST 2008


Hello,

The most common way of dynamically producing HTML is via template
engines like genshi, cheetah, makotemplates, etc.

These engines are 'inline' --- they intersperse programming constructs
with the HTML document itself.

An opposite approach to this form of dynamic HTML production is called
push-style templating, as coined by Terence Parr:
    http://www.cs.usfca.edu/~parrt/papers/mvc.templates.pdf

I keep a list of push-style templating solutions for all languages
here:
    http://www.perlmonks.org/?node_id=674225#python

And wanted to update the list of Python ones.

Notes:
- nagare has updated meld3 so the replace method can replace with
entire HTML trees, not just plain text node. the author of meld3
(chrism) seems to be out of touch: he hasnt responded to my last 2
emails
- basic xml processors are typically a bit too low level for
convenient xhtml processing. for example, lxml and elementtree are
both powerful xml processors, but webstring makes them much more
useable for xhtml processing
- the amara xml toolkit is very attractive. It shows how to climb on
top of a low-level XML processing suite (the 4suite tools) and
dynamically produce XHTML with Pythonic idioms. But I get the willies
when the quickref tutorial is a broken link - http://uche.ogbuji.net/tech/4suite/amara/quickref
- if there are any other new solutions in Python for this, I would
like to know about them.



More information about the Python-list mailing list