[Zope] dynamically generated TAL not being interpreted

Dieter Maurer dieter@handshake.de
Mon, 3 Mar 2003 20:56:46 +0100


N. Thomas wrote at 2003-3-1 23:46 -0500:
 > We have a script that generates TAL. The problem is that the content is
 > not being interpeted as TAL by Zope, but rather as raw HTML.
 > 
 > A search through the mailing lists archives found a posting from last
 > September where someone was trying to do something similar. According to
 > one of the replies, the HTML is supposed to have the TAL namespace
 > declaration, so I changed my code to produce something like this at the
 > top:
 > 
 >     <html xmlns:tal="http://xml.zope.org/namespaces/tal"
 >           metal:use-macro="here/main_template/macros/master">
 > 
 > But the problem persists.
 > 
 > Does anyone know how I can do this?

You cannot return TAL source code and expect it to be rendered.

You must make a Page Template object from your TAL source code,
wrap it in an appropriate context (--> "__of__") and return it (or call it
to let it render).

You can do this only in an External Method (or other filesystem
based code).


Dieter