Hi all,
I have got a problem which is probably simple to solve but as I have been struggling over it for days so need some help.
I wish to use XSLT to transform XML data into HTML. One of the elements I wish to display is, for example, IsActivated which is basically a boolean yes/no element (actually stored as 1 and 0). I don't know how our system does it, but if this value it 1 it displays "yes" in the html page, and for 0 "no". What I want to be able to do is change "yes" and "no" into teh norwegian alternatives, ja and nei. I have been told that XSL IF will do this but as I am a beginner I think I need a little more help. This is a bit of my code. The first <TD> tag is fine and pulls up info from the TMProject Table. I need to do the same for the second <TD> tag excpet instead of displaying what is stored in the table, i change it to either ja or nei. I know what I have is wrong because the column comes out blank:
<code>
<TD><xsl:value-of select="TM_PROJECT.SUMMARY" disable-output-escaping="yes"/> </TD>
<TD><xsl:value-of select="CUSTOM_Travel" disable-output-escaping="yes"/><xsl:if test="./VALUE = 1 ">Ja</xsl:if> <xsl:if test="./VALUE = 0"><td>Nei</td></xsl:if> --></TD>
</code>
Let me know if you need to see more of my code, but i think this is the relevant part. HELP!
Divinyl
I have got a problem which is probably simple to solve but as I have been struggling over it for days so need some help.
I wish to use XSLT to transform XML data into HTML. One of the elements I wish to display is, for example, IsActivated which is basically a boolean yes/no element (actually stored as 1 and 0). I don't know how our system does it, but if this value it 1 it displays "yes" in the html page, and for 0 "no". What I want to be able to do is change "yes" and "no" into teh norwegian alternatives, ja and nei. I have been told that XSL IF will do this but as I am a beginner I think I need a little more help. This is a bit of my code. The first <TD> tag is fine and pulls up info from the TMProject Table. I need to do the same for the second <TD> tag excpet instead of displaying what is stored in the table, i change it to either ja or nei. I know what I have is wrong because the column comes out blank:
<code>
<TD><xsl:value-of select="TM_PROJECT.SUMMARY" disable-output-escaping="yes"/> </TD>
<TD><xsl:value-of select="CUSTOM_Travel" disable-output-escaping="yes"/><xsl:if test="./VALUE = 1 ">Ja</xsl:if> <xsl:if test="./VALUE = 0"><td>Nei</td></xsl:if> --></TD>
</code>
Let me know if you need to see more of my code, but i think this is the relevant part. HELP!
Divinyl