[Zope] DTML html_quoting my JavaScript

Dieter Maurer dieter at handshake.de
Mon Feb 21 13:46:57 EST 2005


Andrew Maclean wrote at 2005-2-21 08:38 +0000:
>I've got myself into a problem with DTML.  The system I've been working on 
>uses a lot of JavaScript, which is stored in DTML methods.  After 14 months 
>of development, I have been asked to reproduce the installation on another 
>machine, where, unlike the original installation, all my <dtml-variables> 
>are html_quoted, rendering them useless.
>
>According to the Zope book, <dtml-vars> are always html_quoted.  I know this 
>is not the case because for over a year I could successfully store 
>JavaScripts in DTML methods.  Then there is no html_unquote function.

Indeed, dtml variable usually are not html quoted -- unless
they have a sticky content (come from REQUEST).

However, when you reference DTML objects, it is very
easy to get an apparently HTML quoted result:

     <dtml-var dtml_object>

will not be HTML quoted but

     <dtml-var "dtml_object">

appears to be.

In fact, the first form calls the "dtml_object" (which means render it)
while the second converts it to a string -- which returns the
source, HTML-quoted such that you can read the source in your browser.

-- 
Dieter


More information about the Zope mailing list