On Fri, Dec 30, 2005 at 11:22:56AM +0100, 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" />

How would you express

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


AFAIR if you use the XML Namespaces spec, you can only have one ':' in
an attribute name, so this would be invalid:

  <my_xml_element attr:xlink:href="some/url"
                  attr:xlink:href="some/title" />

> The same would probably be relevant for tal:defines, something like:
> <div define:mammals="here/getMammals"
>      define:fish="here/getFish"
>  />

You can do things like

  <div tal:define="foo view/foo;
                   bar foo/bar;
                   baz python:bar and 'something' or 'somethingelse';
                   qux string:my_class $baz" />

because the ordering of definitions is explicit.

How would you specify the order of definitions if you used separate
attributes in the define: namespace?  Attributes have no order in XML.

Marius Gedminas
C++ is a loaded machine gun helpfully pointed at your feet with the safety off.
        -- ChaosDiscord on Slashdot

Attachment: signature.asc
Description: Digital signature

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

Reply via email to