[albatross-users] Re: Python embedded like PHP

Ian Bicking ianb at colorstudy.com
Fri Mar 22 11:17:38 EST 2002


On Thu, 2002-03-21 at 17:50, Andrew McNamara wrote:
> 
> > > Albatross encourages (but doesn't enforce) the separation of presentation
> > > and logic. You might do something like this in Albatross:
> > >
> > >     <ul>
> > >     <al-for iter="reptile" expr='["Crocodile", "Python", "Iguana", "Tortoise"]'>
> > >       <li><al-value expr="reptile.value()" whitespace></li>
> > >     </al-for>
> > >     </ul>
> >
> > Why, oh why, does it use HTML-like syntax?  People keep implementing
> > templating languages that do this over and over, and it's a bad, bad
> > idea.  Any moderately complex example of templating will violate the
> > rules of HTML/SGML, with things like <img src="<al-value
> > expr="something">">, which is horrible to read, will anger WYSIWYG
> > editors to no end, and isn't at all necessary.
> 
> The intention is that Albatross templates be valid XML - while Albatross
> will do the expected thing in the example you give above, it generally
> provides a "better" way, such as:
> 
>         <al-img expr="something">

Do you mean that you have a template tag for every kind of tag for which
you would want to modify an attribute?  That's every single HTML tag --
IMG is hardly the only one.  A dynamic CSS class attribute, for
instance, or events (onMouseOver, etc), id tags, background colors...
there's a million possibilities.

Plus you've got the same problems ZPT has, where it's not really proper
-- or perhaps even possible -- to dynamically generate CSS or Javascript
with your language, since they are generally guarded by comments and are
thus opaque to XML.

XML just seems so darn *hard*.

  Ian





More information about the Albatross-users mailing list