[Zope] tal:atrributes problem

Jürgen Herrmann Juergen.Herrmann at XLhost.de
Wed Mar 23 08:42:36 EST 2005


[ Lennart Regebro wrote:]
> On Wed, 23 Mar 2005 13:17:07 +0100 (CET), Jürgen Herrmann
>> as far as i remeber the selected attribute should only contain
>> 'selected' if you'd like to be xhtml compliant.
>>
>> but hey, if your version works with the standard browsers, i'll also go
for this version, cause it's much more readable...
>
> Well, this code:
>             <option tal:repeat="statusid statuslist"
>                     tal:attributes="value statusid;
>                                     selected python:status==statusid"
>                     tal:content="statusid" />
>
> results in this html:
>
>             <option selected="selected" value="ACCEPTED">ACCEPTED</option>
>
>             <option value="DECLINED">DECLINED</option>
>             <option value="TENTATIVE">TENTATIVE</option>
>             <option value="DELEGATED">DELEGATED</option>
>
> So it seems to be fine (For Zope 2.7.4 at least).

looks fine! i thought it would produce something like :
 <option selected="True" value="ACCEPTED">ACCEPTED</option>
                   ^^^^
though i had never tried it before...

as i looked at TALInterpreter.py, obviously 'selected' is one of a handful
of html attributes that get special treatment...

line 33:
BOOLEAN_HTML_ATTRS = [
    # List of Boolean attributes in HTML that should be rendered in #
minimized form (e.g. <img ismap> rather than <img ismap="">) # From
http://www.w3.org/TR/xhtml1/#guidelines (C.10)
    # XXX The problem with this is that this is not valid XML and
    # can't be parsed back!
    "compact", "nowrap", "ismap", "declare", "noshade", "checked",
"disabled", "readonly", "multiple", "selected", "noresize",
    "defer"
]

regards, juergen herrmann
_______________________________________________________________________

>> XLhost.de - eXperts in Linux hosting <<

Juergen Herrmann
Weiherweg 10, 93051 Regensburg, Germany
Fon:  +49 (0)700 XLHOSTDE [0700 95467833]
Fax:  +49 (0)721 151 463027

ICQ:  27139974  -  IRC: #XLhost at quakenet
WEB:  http://www.XLhost.de



More information about the Zope mailing list