I have to filter/assign data from payload to xml tags based on if else condition using xslt.
I have to apply the if-else on "RIMSTS" tag, I'm using the below code to apply.But it is not working.It is throwing some invalid xslt during validation.Can someone help me with proper syntax or proper way to apply if-else in for-each.
<xsl:for-each select="message/lines">
<LINE_SEG>
<xsl:if test="not(normalize-space(costAmount)) = ''">
<CSTMS_CST>
<xsl:value-of select="normalize-space(costAmount)"/>
</CSTMS_CST>
</xsl:if>
<PO_CHANNEL></PO_CHANNEL>
<xsl:choose>
<xsl:when test="linestatusCd = 100">
<RIMSTS>OPEN</RIMSTS>
</xsl:when>
<xsl:when test="linestatusCd= 200 or 300">
<RIMSTS>CLOSED</RIMSTS>
</xsl:when>
</LINE_SEG>
</xsl:for-each>
</xsl:choose>tag. -- P.S. If you're getting an error message, the smart thing to do is to reproduce it verbatim.