You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Tim Bachta <tb...@kopent.com> on 2003/06/12 17:48:50 UTC

Using xsl:if

I am trying to do an if statement to select a template according to
values of an element.  I have this

 <http://localhost:8080/cocoon/vyzo/login?cocoon-view=first##> -
<<parameter>

 <http://localhost:8080/cocoon/vyzo/login?cocoon-view=first##> - <
<parameter-name>

  <    BeginEndDate 

  </parameter-name>

 <http://localhost:8080/cocoon/vyzo/login?cocoon-view=first##> - <
<parameter-name>

  <    Locations 

  </parameter-name>

 </parameter>

 

and I want to do :

if(element(parameter-name) == BeginEndDate)

{

            do this;

}

else if (element(parameter-name) == Locations)

{

            do that;

}

 

Any help will be greatly appreciated.  Thank you.

 

Tim Bachta

 

 

 


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Using xsl:if

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Tim Bachta wrote:
> I am trying to do an if statement to select a template according to
...
> and I want to do :
> 
> if(element(parameter-name) == BeginEndDate)
> {
>             do this;
> }
> else if (element(parameter-name) == Locations)
> {
>             do that;
> }

XSLT questions are best sent to the XSL list:
  http://www.mulberrytech.com/xsl/xsl-list/

In either case, I had a few difficulties in deciphering your
problem description, but maybe you want
   <xsl:choose>
     <xsl:when test="parameter-name='BeginEndDate'">
       do this
     </xsl:when>
     <xsl:when test="parameter-name='Locations'">
       do this
     </xsl:when>
   </xsl:choose>

Perhaps you should buy yourself a good XSLT introduction book,
the XSL FAQ linked from the URL above has a list.

J.Pietschmann


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org