[Zope] prevent quoting in tal:attributes

Passin, Tom tpassin at mitretek.org
Fri Sep 12 13:32:22 EDT 2003


[Milos Prudek]
> How can I prevent quote escaping in tal:attributes? My attribute 
> contains many quotes itself, and ZPT automatically escapes them.
> 
> Details:
> ...
> The result of this when rendered via ZPT is this:
> 
> onmouseover="MM_swapImage("contacts", "", 
> "/contacts_on_cs.gif", 0)"
> 
> I need to change those " back to single quotes. In tal:replace I 
> could use the "structure" modifier, but it does not work for 
> tal:attributes.

You do not have to change the " back.  The browser will do that for
you when it parses the attribute values.  Although I knew that this is
how things are supposed to work, I just tested it (using your example)
in IE and Mozilla/Firebird, and it worked as expected - the mouseover
called the function correctly (I wrote a tiny function that popped up an
alert).  So not to worry.

Cheers,

Tom P



More information about the Zope mailing list