Hi Malthe
Betreff: [Zope-dev] ZPT attributes and ""
Currently, if an attribute expression evaluates to any value that's boolean False, it's omitted (e.g. 0, "", object()). I think that's unexpected. Instead, attributes should only be omitted when the expression evaluates to ``None``.
I think this is better then render empty strings. see below...
How do folks feel about changing this behavior in ``zope.pagetemplate``.
Probably anything else then "" should be skipped. There is no logic why object() or False should get rendered as "". I only whould expect that an empty string whould get rendered as "". And probably we should check the HTML specification and make sure that we only render empty strings for attributes where they are allowed. see: http://www.w3.org/TR/html401/types.html#type-name ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). This means to me that an empty value for id or name doen't start with [A-Za-z] and is invalid because is must start with [A-Za-z]. or not? Regards Roger Ineichen
\malthe _______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )