[Zope] escaping html tags during method calls

Thomas B. Passin tpassin@mitretek.org
Tue, 7 May 2002 11:20:19 -0400


When you write <dtml-var m1>, Zope ***calls*** object m1, which is what you
want here.  When you write <dtml-var "m1">, you have asked Zope to evaluate
the Python expression m1.  In this case, this gives you the (escaped) string
representing the m1 object - in other words, a description of the object, as
opposed to the results of calling the object.   Sometimes this is what you
want, but not here.

Writing <dtml-var "m1()"> tells Zope to evaluate the Python expression
"m1()", which is what you want because Python will know to call the object
if it is callable.

Cheers,

Tom P

[Dan Meszaros]
>
> i'm very confused by zope's behaviour when calling dtml methods.
>
> let's have method m1 that returns
>   <p>
>   hello
>   </p>
>
>
> when i do
>   <dtml-var standard_html_header>
>   <dtml-var "m1">
>   <dtml-var standard_html_footer>
>
> i get:
>   ...
>   &lt;p&gt;
>   hello
>   &lt;/p&gt;
>   ...
>
>
> when i do
>   <dtml-var standard_html_header>
>   <dtml-var m1>
>   <dtml-var standard_html_footer>
>
> i get
>   ...
>   <p>
>   hello
>   </p>
>   ...
>
> which is ok.
> unfortunatelly i need to call method, that is not in the same
> directory, parser forces me to use double-quotes. being not satisfied
> with the result mentioned above (first example) i tried
>