[Zope-dev] Re: TALES idea: tuple unpacking

Shane Hathaway shane@zope.com
Tue, 29 Jul 2003 17:38:18 -0400


Fred L. Drake, Jr. wrote:
> Shane Hathaway writes:
>  > - You have to be careful not to use double quotes in expressions. 
>  > (Ampersands and less-than/greater-than signs are tricky too.  Watch out 
>  > for pairs of hyphens!)
> 
> This is FUD.  TAL can handle these things quite well; the "problem" is
> that many web developers don't have a clear understanding of layers of
> encoding (a seriously unfortunate state of affairs, though
> understandable given the time pressures of creating/updating a site).
> Encoding quotes inside an attribute values means that the expression
> (Python or not) is harder to read, but if it doesn't still work,
> there's a bug in the implementation.  I'll be glad to donate some of
> my time to fix any such bugs.
> 
> Othan than this, I agree with you on this topic.

I'm not quite sure what you're saying.  The following fails compilation:

<span tal:content="python: "abc"" />

Hence you need to be careful not to use double quotes in expressions.  I 
run into this every day.

I'm a little wary of expressions like this:

<span tal:content="python: 1 > 0" />

... being converted by buggy XML or HTML software to this (I've seen it 
happen before):

<span tal:content="python: 1 &gt; 0" />

Finally, if you use a pair of hyphens in an expression and later use XML 
syntax to comment it out while leaving the pair of hyphens, the block is 
technically not well-formed.

http://www.w3.org/TR/REC-xml#sec-comments

For example:

<!--
<span tal:content="python: 'What should we do--walk or run?'" />
-->

This is not something that should bother anyone, but I wanted to support 
my assertion. ;-)

Shane