[ZPT] URLs and stuff

Evan Simpson evan@digicool.com
Tue, 1 May 2001 00:01:29 -0500


From: <richard@bizarsoftware.com.au>
> <body tal:process="here/munge_urls">
> </body>
>
> Where munge_urls would be passed the parsed content of the tag. It
should
> then be able to add/remove/modify tags/attributes as needed.

This appeared in early drafts as the tal:method statement.  The problem
we ran into, still unresolved, is how to properly implement it.  I want
this feature very much, but I don't know how to get it right! Perhaps if
I lay out the difficulties, you can help resolve them:

TAL uses an event-driven parser to convert the template source into an
intermediate "program".  At render time, this program is combined with
other programs (if macros are used) and interpreted to produce output.

1. When should arbitrary munging take place?  Before, during, or after
TAL parsing?  If after, then before, during, or after interpretation?

2. How should the munger "see" the source code, for manipulation
purposes?  At no time is anything resembling a DOM tree constructed (a
DOM was how we originally envisioned implementing tal:method).

Depending on your answers to these two questions, a number of others may
arise, including interactions with other TAL commands such as
'condition' and 'repeat'.

Help!

Evan @ digicool