[albatross-users] XML and Albatross templates?
Andrew McNamara
andrewm at object-craft.com.au
Thu May 5 14:03:31 EST 2005
>I forget how it goes off the top of my head, but investigate the Jakarta
>Struts logic tag library. I know there is an if/then/else type tag
>structure, and I'm relatively certain it's valid XML.
This sort of thing?
<logic:if name="calendarBean" property="month" op="equal" value="January" >
<logic:or name="calendarBean" property="year" op="LessEqual" value="1999"/>
<logic:or name="calendarBean" property="day" op="equal" value="Monday"/>
<logic:then>
At least one of the above conditions is true.
</logic:then>
<logic:else>
All of Above conditions are false
</logic:else>
</logic:if>
I suspect something like the following is closer to the spirit of the
current Albatross code:
<al-if expr="...">
abc
<al-elif expr="...">
def
</al-elif>
<al-elif expr="...">
ghi
</al-elif>
<al-else>
jkl
</al-else>
</al-if>
But I don't see that as any sort of improvement over the <al-lookup>
suggestion. And the parser currently only has the concept of empty or
containing elements - this would require (for backward compatability)
support for containing elements with optional close tag (as HTML has).
>The "anytag" scheme looks sweet, count me in.
It's there now in the dev snapshot - feedback, gotchyas, etc gratefully
received.
--
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/
More information about the Albatross-users
mailing list