[Zope] Proposal: Include tino's patched <dtml-in> in future Zope

Toby Dickenson tdickenson@geminidataloggers.com
Tue, 27 Feb 2001 08:38:01 +0000


On Tue, 27 Feb 2001 10:01:18 +1100, Curtis Maloney
<curtis@cardgate.net> wrote:

>Now, I know a lot of people think DTML should be left to die, but =
personally=20
>I think it is not given enough credit.  DTML is a wonderful language, =
and can=20
>greatly ease peoples transition from other systems into Zope.

dtml is good enough for document templates, however there are serious
quality issues for anything involving logic.

Lets analyse this

>>     <dtml-in ... prefix=3D"outer">
>>         <dtml-in ... prefix=3D"inner">
>>             <dtml-var expr=3D"outer_item * inner_item">
>>         </dtml-in>
>>     </dtml-in>

By the time it gets to evaluating the dtml-var, the namespace stack
contains:
1. an element from the inner sequence
2. inner_stuff
3. an element from the outer sequence
4. outer_stuff
5. the namespace provided by the caller

The dtml-var is looking up two names in the namespace. We know it
expects to find the values that were provided by the dtml-in tags,
however it is possible for something higher up the namespace stack to
provide a different value under the same name, breaking your dtml-var
expression.

Where can it go wrong?

a. If an object which is an element of the inner sequence has an
attribute outer_item.

b. If anything in the acquisision context of an element of the inner
sequence has an attribute outer_item.

c. If an object which is an element of the inner sequence has an
attribute inner_item.

d. If anything in the acquisision context of an element of the inner
sequence has an attribute inner_item.

e. If an object which is an element of the outer sequence has an
attribute outer_item.

f. If anything in the acquisision context of an element of the outer
sequence has an attribute outer_item.




On Tue, 27 Feb 2001 09:56:17 +1100, Itai Tavor <itai@optusnet.com.au>
wrote:

>citing some irrelevant concern about polluting the namespace.

namespace pollution is less serious if you have a greater number of
namespaces, and more serious if you have fewer.

dtml is the only language I know which only provides *one* namespace.


Toby Dickenson
tdickenson@geminidataloggers.com