cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT check multiple conditions

Former Member
0 Kudos

hello

I don't know whether this would be appropriate in this forum but one of my interface has XSLT mappings and we have to add certain conditions for some tags to get generated.

I checked XSLT APIs and found out <xsl:if> tag and my one condition works fine.

e.g. <xsl:if test="$flg_type='xyz' >

<tags to be generated>

</xsl:if>

But now the requirement is like those tags should get generated when flg_type = 'xyz' or flg_type = 'abc' and 5 such conditions.

Does anyone know how to add "OR" or "AND" condition inside <xsl:if>

Thanks in advance.

Regards

Rajeev

Accepted Solutions (0)

Answers (2)

Answers (2)

MichalKrawczyk
Active Contributor
0 Kudos

hi,

did you try:

<xsl:if test="($flg_type='xyz') or ($flg_type='abc') " >

Regards,

michal

Former Member
0 Kudos

AFAIK, this works with

[code]<xsl:if test="$flg_type='xyz' OR $anotherOne='abc' OR $third='123' ">

...

</xsl:if>[/code]

Shabarish_Nair
Active Contributor
0 Kudos

i guess instead of CAPS it sud be in small letters. So it sud be;

<xsl:if test="$flg_type='xyz' or $anotherOne='abc' or $third='123' ">

...

</xsl:if>

Do correct me if i am wrong here !!!

Shabarish_Nair
Active Contributor
0 Kudos

Looks good

Ref: http://msdn2.microsoft.com/en-gb/library/ms256081.aspx (only small letters form the syntax)

Former Member
0 Kudos

> Do correct me if i am wrong here !!!

Looks good - it's been 1 year since I last used it...