Alexander Limi wrote:
> 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;" />
> etc.
> 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"
>      define:fish="here/getFish"
>  />
> 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! :)

It's especially much easier to format with a lot less whitespace...

> What do y'all think?


Steve presented me with that idea once too and I remember I had some
negative feelings about it. I don't remember what they were, though :).

I'd suggest that the namespace prefixes be talattr and taldefine just to
be clear on what they belong too. Of course, I'd prefer if ZPTs would
stop magically assuming certain namespace prefixes completely.

Btw, we also need this for i18n:attributes which I guess would become

> 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. :)

I've tried to answer the three most important points of criticism in a
blog entry:

Zope3-dev mailing list

Reply via email to