[Petal] Re: Looking for Petal info

Evan Simpson evan@4-am.com
Tue, 30 Jul 2002 08:51:38 -0500


Jean-Michel Hiver wrote:
> Why not write:
> 
> <tal:condition name="user/is_birthday"> ??

Partly because of the way the syntax evolved; it was a relatively late 
addition to TAL, introduced to help deal with situations where you had 
to add a lot of <div>s or <span>s to get the order of operations right, 
and for XML dialects that don't provide 'neutral' tags like these two. 
In these cases, we often end up writing code like this:

<tal:prepdata define="..." condition="...">
   <tal:mainloop repeat="..." on-error="...">

...that is, multiple statements per element.  Another virtue this turned 
out to have is distinctive closing tags.  After a bunch of intervening 
text, which of the following would you rather see the example above 
closed by?

</div></div>

..or..

</tal:on-error></tal:repeat></tal:condition></tal:define>

..or..

</tal:mainloop></tal:prepdata>

I hope that these particular issues will become less import with the 
introduction of a stylesheet-based TAL extension.

Cheers,

Evan @ 4-am