mardi 31 janvier 2017

XSLT: How to emulate an IF-ELSE clause

Problem:

IF COND1 = true
{
    WHEN COND2 = TRUE
    {
        PRINT X1
    }
    OTHERWISE 
    {
        WHEN COND3 = TRUE {PRINT X2}
        OTHERWISE {PRINT X3}
    }
}

I have use for COND1 and , for COND2 and COND3 but its printing value X1 for all conditions. Can someone pls tell me how to apply above scenario?

<xsl:if test="($Id='5')">
<xsl:choose>
 <xsl:when test="(Cond='') "></xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="(Cond='true')or(Cond='Y')">Y</xsl:when>                                                                                   
<xsl:otherwise>N</xsl:otherwise></xsl:choose>
</xsl:otherwise>    
</xsl:choose>
</xsl:if>

Aucun commentaire:

Enregistrer un commentaire