On Thu, 29 Dec 2005 15:49:46 +0100, Philipp von Weitershausen <[EMAIL PROTECTED]> wrote:

I think it would be quite possible to do explicit key or attribute
lookup with TALES, e.g.:

  foo/attr:bar  (for foo.bar)
  foo/key:bar   (for foo['bar'])
  foo/item:1    (for foo[1])

This reminds me of a thing Steve Alexander and myself talked about when working together on a project using Zope 3 a while back:

One of the ugliest and most error-prone parts of TAL is its handling of multiple attributes:

<a tal:attributes="href some/url;
                   title some/title;" />


We looked at having a separate namespace for these kinds of statements. The above code would then be:

<a attr:href="some/url"
   attr:title="some/title" />

thus doing away with the need for semicolons and the "should the last line have a semicolon or not" confusion.

The same would probably be relevant for tal:defines, something like:

<div define:mammals="here/getMammals"


This provides the following benefits:

- Easier to parse for XML tools (no semicolons with any meaning)

- More consistent syntax, no need to learn a special way to separate several attributes/defines

- It looks nice! :)

What do y'all think?

For the record, I'm also for getting rid of the python: stuff in TAL, but only if we can solve the common use cases others have identified earlier in this discussion. Making ZPT carry less smarts and preferrably get it a bit faster would be very welcome in my universe. :)


     Alexander Limi · Chief Architect · Plone Solutions · Norway

 Consulting · Training · Development · http://www.plonesolutions.com

      Plone Co-Founder · http://plone.org · Connecting Content
  Plone Foundation · http://plone.org/foundation · Protecting Plone

Zope3-dev mailing list
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to