[ZPT] Re: TAL's lack of an else...

Jean-Michel Hiver jhiver at mkdoc.com
Wed Aug 6 18:13:25 EDT 2003


> > If you are going to argue against having repeat and if in TAL 
> > then you're in 
> > for plenty of fun on this list :-)
> 
> Nope, I'm not arguing on this ;) Every element within repeat is templated according to a same design.
> 
> I'm also not defending TAL for it's lack of IF/ELSEIF/ELSE construct.

The really nice thing about TAL is that you don't need to worry about
balancing your instructions, i.e. having end-loop, end-if, etc.

As long as something is well-formed XML, then it's ok with TAL.

Introducing an else / elsif would break that and introduce plenty of
non-sense cases. In other words, I simply think the traditional if /
elsif / else construct is just not compatible with TAL and would make it
look completely clumsy.

If you really really **REALLY** want a 'tal:else' construct I recommend
you hack the code in those lines:

s/tal:else="/tal:condition="not:/g;

:)



More information about the ZPT mailing list