How to Compare value of an xml node with a String using xsl : if
Dear Experts,
I have an xml file with the following structure :
<YTD>
<ProfitCenterCode>118</ProfitCenterCode>
<BalanceYTD>-2,785.20</BalanceYTD>
<Currency>EUR</Currency>
</YTD>
<YTD>
<ProfitCenterCode>Total</ProfitCenterCode>
<BalanceYTD>-7,956.28</BalanceYTD>
<Currency>EUR</Currency>
</YTD>
My requirement is : whenever the value of <ProfitCenterCode> equals the String "Total"
I want to call a styleID which will make my BalanceYTD value print in bold in an excel sheet.
To achieve this, I have written a code , but it does not seem to work. Can you please advise:
<xsl:for-each select="//YTD">
<xsl:if test="ProfitCenterCode=Total">
<Cell ss:StyleID="sMAKETOTALBOLD">
<Data ss:Type="Number"><xsl:value-of select="BalanceCarryFwd"></xsl:value-of></Data> </Cell>
</xsl:if>
</xsl:for-each>
|