[Zope3-dev] attr name space (was: RFC: abolishing python:
expressions)
Marius Gedminas
mgedmin at b4net.lt
Fri Dec 30 15:20:01 EST 2005
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-dev/attachments/20051230/0e90a14a/attachment.bin
More information about the Zope3-dev
mailing list