[Zope] DTML namespaces

Peter Bengtsson mail@peterbe.com
Tue, 3 Jul 2001 11:20:08 +0200


I'm going to convert my DTML templates to Page Templates, but in doing so I
have to debug my old messy DTML.

If my DTML is: <dtml-var "REQUEST.form['name']">, I then know where it comes
from. That's a lot better than <dtml-var name>.

Would it be possible to use some kind of debugger or something to see where
things come from at run time?

I can imagine that the renderer of DTML looks something like this:

<pseudo code>
# Someones written <dtml-var name>, let's find it
if REQUEST.has_key('name'):
    return REQUEST.name
elif DTMLtemplate.has_key('name')
    return DTMLtemplate.name
elif Container.has_key('name'):
    return Container.name
elif Aquisitionpath.has_key('name'):
    return Aquistionpath.name
else:
    raise NameError, "Can't find 'name'"
</pseudo code>

If this exists, I could add a bunch of print lines in there to debug where
things come from and then I could see exactly how to rewrite my DTML to TAL.
Anybody familiar with this?


Cheers, Peter