Re: [xsl] Using multiple conditions in the xsl:if statement

Subject: Re: [xsl] Using multiple conditions in the xsl:if statement
From: Michael Ludwig <mlu@xxxxxxxxxxxxx>
Date: Wed, 26 Mar 2008 16:36:29 +0100
Davalath, Kishore schrieb:
I'm using the following xsl and I would like to know how do I use
multiple conditions in the same if statement.  If I pass multiple
conditions it does not return any results because if the first condition
matches and there is no match in the second condition I'm not getting
any results.  Ideally I would like not to perform the test at all if
there is no value in the $lname variable or $pubid varialbe or only use
the corresponding test if there is any value in the variables. Is there
anyway to do that?

Use more boolean logic:


<xsl:if test="
  ($pubid and Html/root/Publication = $pubid) or
  ($lname and Html/root[contains(AssocLawyers/a/text(), $lname)])">

          <xsl:if test ="Html/root/Publication = $pubid or
Html/root[contains(AssocLawyers/a/text(), $lname)]" >

Michael


Current Thread