0

How to I combine the first if statements and the second if statements? I need to add the second if statement conditions as extra conditions into the first if statement? The first if statement conditions should remain as they are, but add more conditions from the second if statement. For example not adding Op='E' to Integration/Case/@Op !='A'. These conditions on first if statement are independent of the conditions on the second if statement. The second if statement logic is as follows IF Integration/Case/@Op='E' AND Integrations/Case/Deleted has no Op codes AND Integrations/Case/Expunged has no Op codes

First if statement

<xsl:if test="((Integration/Case/@Op !='A') or (string-length(Integration/Case/@Op)=0))">
</xsl:if>

Second if statement

 <xsl:if test="((Integration/Case/@Op ='E') and (string-length(Integration/Case/Expunged/@Op)=0) and (string-length(Integration/Case/Deleted/@Op)=0))">
    </xsl:if>
  • look up `xsl:choose` statement. Also, you can nest `if` statements as well. Note: you don't need brackets around the entire test condition. This also applies for `and`, `or` operators in your case, since they have lower precedence that `=` and `!=`. – yas Jun 22 '17 at 17:43
  • 1
    Possible duplicate of [How to implement if-else statement in XSLT?](https://stackoverflow.com/questions/13622338/how-to-implement-if-else-statement-in-xslt) – kjhughes Jun 22 '17 at 17:52
  • "*These conditions on first if statement are independent of the conditions on the second if statement.*" Not entirely, because if something is equal to "E" then it must be not equal to "A". – michael.hor257k Jun 22 '17 at 20:36

0 Answers0