Here is xslt constructs for if and choose.
<xsl:if
test = boolean-expression>
<!-- Content: template -->
</xsl:if>
<xsl:choose>
<!-- Content: (xsl:when+, xsl:otherwise?) -->
</xsl:choose>
<xsl:when
test = boolean-expression>
<!-- Content: template -->
</xsl:when>
<xsl:otherwise>
<!-- Content: template -->
</xsl:otherwise>
To me, what Eduardo proposes seems to be a better alternative
than xsl or Craig's impl.
My 2 cents.
Suresh
----- Original Message -----
From: "Eduardo Pelegri--Llopart" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 14, 2000 9:07 AM
Subject: if syntax...
> Craig proposes...
>
> <struts:ifCondition ...>
> ...
> </struts:ifCondition>
> <struts:else>
> ...
> </struts:else>
>
> I think it will be hard to describe the exact semantics of this
> construct. E.g. what happens to the text between the IfCondition and
> the else? What happens if you have another ifCondition? what happens if
> you have an else with no ifCondition...
>
> The "traditional" approaches use nested tags and I think are not that
> bad looking. What about any of the following? THe first two are
> generic select mechanisms, the third one is a plain if. You can have
> more than one.
>
> <!-- this one will choose the first condition that is true. THis is a
> typical lisp-like construct -->
>
> <s:when>
> <s:test cond=" "> ... </s:test>
> <s:test cond="theother"> ... </s:test>
> </s:when>
>
> or
>
> <!-- this is a typical case construct; values in the case values are
> intended to be non-overlapping. There may be a default value -->
>
> <s:select selector="condition">
> <s:case value="true">....</s:case>
> <s:case value="false">...</s:case>
> </s:select>
>
> or
>
> <!-- this is a plain if-then-else. The false branch is optional. -->
>
> <s:if condition="condition">
> <s:true>....</s:true>
> <s:false>...</s:false>
> </s:if>
>
>
> - eduard/o
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets