Wednesday 20 July 2016

XSL - If Else condition Choose When Otherwise

In XSL, there is no If - Else construct. Only If is present.

If your requirement is stricly If - Else, instead use the Choose When Otherwise construct as below:

 <xsl:when test="$a > $b">
  <h2> A is greater than B </h2>
  <h2> B is greater than A </h2>

In the above example, a ($a) and b ($b), are variables.

No comments:

Post a Comment